Press Release: First Northwest Arkansas GiveCamp Announced!

NwaGiveCampLogo

Northwest Arkansas GiveCamp Brings Free Technology Solutions to Non-Profits during Weekend Event

August 22, 2010 -- Fayetteville, AR – Jay Smith, Northwest Arkansas GiveCamp Chairman, announced today that the Northwest Arkansas .Net user Group in Partnership with the University of Arkansas will be hosting the first annual Northwest Arkansas GiveCamp on January 14-16, 2011.

The Northwest Arkansas GiveCamp is a weekend-long event that brings together local technology professionals to providing non-profits with technical solutions and applications they might not otherwise been able to afford.

The Northwest Arkansas GiveCamp is one of many events of this type that are happening all over the country. This unique event allows technology professionals to use the skills they develop every day to provide applications and services that are in need by non-profits.

The Northwest Arkansas GiveCamp will be held in the University of Arkansas Union Ballroom and surrounding meeting rooms.

Charities and Non-Profits requesting help and volunteers willing to offer their time and skills can submit their application on-line at Northwest Arkansas GiveCamp website located at http://nwagivecamp.com.

The press is invited to the event opening to be held on January 14, 2011 at 00 PM where the selected non-profits will introduce themselves and meet their development teams for the first time.

The press is also invited to the event closing where teams will be giving a brief presentation showing the work they have accomplished for each non-profit.

Summary:

Date: January 14-16, 2011
Location: University of Arkansas Union Ballroom

About the Northwest Arkansas .Net User Group
The Northwest Arkansas .NET User Group is a 501(c)(3) non-profit organization that is dedicated to the promotion, education and adoption of Microsoft .NET Technologies. We strive to provide an environment for professionals to network in Northwest Arkansas to foster the free exchange of ideas and information.

 

GiveCamp_480x60_green

Speaking at Houston TechFest on October 9th, 2010

HoustonTechFest2010Logo

I have confirmed I will be attending and speaking that the Houston TechFest 2010 on October 9th, 2010.  I will be presenting my Planning Poker session, recording interviews for User Group Radio and of course talking community any chance I get.

I am also working with Zain Naboulsi about organizing a Community Leadership Town Hall Meeting the night before the conference.  This will be a dinner with an open space/fish bowl style discussion on creating, building, and sustaining community.

Looks like the Houston TechFest site hasn’t bee updated yet so here is the info on my session:

Estimate Your Requirements with Planning Poker

Planning Poker is a consensus-based estimation technique for estimating, mostly used to estimate effort or relative size of tasks in software development . It is a variation of the Wideband Delphi method. In this session you will learn not only what planning poker is but how to facilitate it with your team. Using Planning Poker to estimate task on your project is not only accurate its fun.

Generic Repository for Entity Framework

*UPDATED 9/6/2012*
Thanks to Stephen Dooley for bringing to my attention that Mikael’s post is no longer available.  I have updated the post to include the extension methods that he had originally posted.  You can find them at the end of the post.
*End Update*

I have started trying to learn how to leverage the Entity Framework for a the re-write of the GiveCamp Starter Site and wanted to implement a generic repository for data access like I use on most of my projects.  I started with the example given by Mikael Henriksson’s Post Generic Repository for Entity Framework for Pluralized Entity Set.  I modified it to fit my standard Repository interface and took the liberty of simplifying it in a few places.

I have run this through several test and haven’t found any issues. I would love those with a critical eye to give this a look over and let me know if I am missing anything.

The IRepository Interface

 1: public interface IRepository : IDisposable
 2:    {
 3:      T Get<T>(int id) where T : IEntityWithKey;
 4:      T Get<T>(Expression<Func<T, bool>> predicate) where T : IEntityWithKey;
 5:        IQueryable<T> Find<T>(Expression<Func<T, bool>> predicate) where T : IEntityWithKey; 
 6:      T Save<T>(T entity) where T : IEntityWithKey;
 7:      T Delete<T>(T entity) where T : IEntityWithKey;
 8:    }

I did use the ObjectContextExtensions from Mikael’s post because they did such a good job of solving the issue of getting the EntitySetName. I am not going go into a lot of detail explaining what is going on because a feel the class pretty much explains itself.

The Repository Class:

 1: public class EntityFrameworkRepository : IRepository   
 2: {
 3:     private readonly ObjectContext context;
 4:     public EntityFrameworkRepository()
 5:     {
 6:         context = new WmdDemoEntities();
 7:     }
 8:      
 9:     public EntityFrameworkRepository(ObjectContext entityContext)
 10:     {
 11:         context = entityContext;
 12:     }
 13:     
 14:     public T Get<T>(int id) where T : IEntityWithKey
 15:     {
 16:         IEnumerable<KeyValuePair<string, object>> entityKeyValues = new[] { new KeyValuePair<string, object>("Id", id) };
 17:         var key = new EntityKey(context.GetEntitySet<T>().Name, entityKeyValues);
 18:         return (T)context.GetObjectByKey(key);
 19:     }
 20:     
 21:     public T Get<T>(Expression<Func<T, bool>> predicate) where T : IEntityWithKey
 22:     {
 23:         return context.CreateQuery<T>("[" + context.GetEntitySet<T>().Name + "]")
 24:         .Where(predicate)
 25:         .FirstOrDefault();
 26:     }
 27:     
 28:     public IQueryable<T> Find<T>(Expression<Func<T, bool>> predicate) where T : IEntityWithKey
 29:     {
 30:         return context
 31:         .CreateQuery<T>("[" + context.GetEntitySet<T>().Name + "]")
 32:         .Where(predicate);
 33:     }
 34:      
 35:     public T Save<T>(T entity) where T : IEntityWithKey
 36:     {
 37:         object originalItem;
 38:            if (context.TryGetObjectByKey(entity.EntityKey, out originalItem))
 39:             context.ApplyPropertyChanges(entity.EntityKey.EntitySetName, entity); 
 40:         else
 41:             context.AddObject(entity.EntityKey.EntitySetName, entity);
 42:        
 43:        context.SaveChanges();
 44:        return entity;
 45:     }
 46:     
 47:     public T Delete<T>(T entity) where T : IEntityWithKey
 48:     {
 49:         context.DeleteObject(entity);
 50:         context.SaveChanges();
 51:         return entity;
 52:     }
 53:     
 54:     public void Dispose()
 55:     {
 56:         context.Dispose();
 57:     }
 58:  }
 

Here is an example of usage in a console application

 1: class Program
 2:  {
 3:    static void Main(string[] args)
 4:    {
 5:      IRepository repository = new EntityFrameworkRepository();
 6:        var page = repository.Get<Page>(x => x.PageId == 1);
 7:        Console.WriteLine("Title: {0}", page.Title);
 8:      Console.WriteLine("Content: {0}", page.Content);
 9:        repository.Dispose();
 10:        Console.ReadLine();
 11:    }
 12:  }

I love taking this approach to persistence because it is so flexible and allows me to swap out repository implementations with little issue.

Again love to hear some feedback on this approach.

Mikael Henriksson’s Original Extension Methods

 1: using System.Data.Metadata.Edm;
 2: using System.Data.Objects;
 3: using System.Data.Objects.DataClasses;
 4:  
 5: public static class ObjectContextExtensions
 6: {
 7:     internal static EntitySetBase GetEntitySet<TEntity>(this ObjectContext context)
 8:     {
 9:         EntityContainer container = context.MetadataWorkspace
 10:                                                         .GetEntityContainer(context.DefaultContainerName, DataSpace.CSpace);
 11:         Type baseType = GetBaseType(typeof(TEntity));
 12:         EntitySetBase entitySet = container.BaseEntitySets
 13:                                                     .Where(item => item.ElementType.Name.Equals(baseType.Name))
 14:                                                     .FirstOrDefault();
 15:  
 16:         return entitySet;
 17:     }
 18:  
 19:     private static Type GetBaseType(Type type)
 20:     {
 21:             var baseType = type.BaseType;
 22:             if (baseType != null && baseType != typeof(EntityObject))
 23:             {
 24:                 return GetBaseType(type.BaseType);
 25:             }
 26:             return type;
 27:     }
 28: }

GiveCamp Starter Site v1.2 Alpha Released

GiveCampStartSite

I am happy to announce the alpha release of the GiveCamp Starter Site.  This release is a minor feature release that contains additional fields for volunteer registration to capture Shirt Size and Shirt Style, as well as, a new default theme.

With this release I am also trying to beef up the documentation.  Please download and test this version and look over the new documentation and give me your feedback. 

The new documentation is not complete but the rough outline is there.  If you are interested in joining the team to help with documentation please let me know.

Nwa CodeCamp 2010 New Site!

image11

Due to some hosting issues I was forced to create a new site for the Northwest Arkansas CodeCamp 2010 event.  The good news is I was able to utilize the Event Server project that a few of use have been working and had it up and going in just a few hours.  This is the same project that is currently running the Tyson Developer Conference site.  There are still a few style sheet tweaks to be made but in all the site is up and ready.

With that being said the new site is up and we have a new url: http://nwacodecamp.org and since we are using Event Server you can now register as a speaker and submit your sessions online.

Please forward this information to anyone you feel would be interested in presenting at this years event.

Also, if you or your company is interested in being a sponsor for this event please view out Sponsorship Information or contact me directly at jay@jaysmith.us.

Don’t forget the new site is http://nwacodecamp.org and mark your calendar for October 23, 2010.

Calendar

<<  April 2024  >>
MonTueWedThuFriSatSun
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

View posts in large calendar

Widget Category list not found.

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))X

Tag cloud

    Widget Month List not found.

    Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))X

    Widget AuthorList not found.

    Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))X

    Widget TextBox not found.

    Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))X