How to use linq to entity exept static Db class?

Dec 13, 2010 at 7:53 AM

How to use linq to entity exept static Db class?

Thanks.

Coordinator
Dec 13, 2010 at 8:10 AM

I'm sorry but I don't understand what you mean, could you give a more detailed explanation

Dec 13, 2010 at 9:47 AM
Is it possible to change it to database
using Entity framework (without tons of code)?
namespace Omu.AwesomeDemo.Data { public static class Db { private static readonly IList<Location> Locations = new List<Location> { new Location { Id = 1, Name = "USA" }, new Location { Id = 2, Name = "UK" }, new Location { Id = 3, Name = "Moldova" }, new Location { Id = 4, Name = "France" }, new Location { Id = 5, Name = "Italy" }, new Location { Id = 6, Name = "Germany" }, new Location { Id = 7, Name = "Belgium" }, new Location { Id = 8, Name = "Japan" }, new Location { Id = 9, Name = "China" }, new Location { Id = 10, Name = "Russia" }, new Location { Id = 11, Name = "Mexico" }, new Location { Id = 12, Name = "Canada" }, new Location { Id = 13, Name = "Panama" }, new Location { Id = 14, Name = "Argentina" }, new Location { Id = 15, Name = "Brazil" }, new Location { Id = 16, Name = "Columbia" }, new Location { Id = 17, Name = "Austria" }, new Location { Id = 18, Name = "Greece" }, new Location { Id = 19, Name = "Spain" }, new Location { Id = 20, Name = "India" }, new Location { Id = 21, Name = "Alpachirlandia" }, new Location { Id = 22, Name = "Botswana" }, new Location { Id = 23, Name = "Australia" }, }; }}

 

 

Coordinator
Dec 13, 2010 at 9:58 AM

of course,

you have the IRepo<T> implement it using whatever technology you want and register the implementation ( I do it in WinsdorConfigurator.cs)

Feb 11, 2011 at 7:40 PM
o wrote:

of course,

you have the IRepo<T> implement it using whatever technology you want and register the implementation ( I do it in WinsdorConfigurator.cs)

Do you have an example how I can adapt to access via entity framework?

Feb 12, 2011 at 10:20 AM

Try to use this implementation of IRepo<T>

http://surveymaster.codeplex.com/SourceControl/changeset/view/66115#1619713 - Repo 

http://surveymaster.codeplex.com/SourceControl/changeset/view/66115#1619717 -DbUtil