New Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
While I can't offer insight into your problem, I just wanted to chime in: These sorts of issues are why I like to use a layer on top of EF. I will usually implement a generic repository pattern. This...
View ArticleNew Post: Referential integrity constraint violation occurred
How to fix:http://stackoverflow.com/questions/20706331/referential-integrity-constraint-violation-occurred
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
General repository hides away all the powerful feature (like Include) that available when working directly with ORM. I can suggest keep away from general repositories and write custom repositories for...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
Actually, if you do it right, you don't have to sacrifice .include when using an abstract repository pattern. I can elaborate and blog on this topic, but IRepository<T> means you can still return...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
In this case you miss one of the main point of repository pattern - decoupling from storage implementation (it would be hard to move to other storage architecture with the same level of support of...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
I haven't missed that point. It's an unfortunate side effect of using EF with the generic repository pattern, and I have discussed this at length with other talented developers such as yourself. It is...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
Plus, in my book, decoupling is more about ensuring testability, rather than making sure it's seamless to switch data access/ORM frameworks.
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
I understand you point. If it's works for you it's ok. In my projects I came to understanding that it's bad to use generic repositories since the DbSet itself is the implementation of repository...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
I see your point, and while it is definitely a repository pattern already, I find that due to the dependency inversion principle, it's too concrete just to go direct to EF. I do all of my testing with...
View ArticleNew Post: EF6 support for ASP.NET WebForms EntityDataSource
I've been using VS2013 since shortly after it was released. I only code in VB and frequently use ListView and GridView. I've been struggling with EF6 and its relationship to these controls without...
View ArticleNew Post: EF6 support for ASP.NET WebForms EntityDataSource
Hi Dave, It's somewhat off-topic, but the reason you don't find many VB examples is because nobody inside MS uses VB except to make VB examples. Like you, I was more comfortable with VB and have done...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
kainazzzo wrote: Actually, if you do it right, you don't have to sacrifice .include when using an abstract repository pattern. I can elaborate and blog on this topic, but IRepository<T> means you...
View ArticleNew Post: DbExpression.Cast and exceptions
Is there any way to deal with scenarios like this: var cast = SomeDbExpression.Cast(InvalidCastType); Lets say the value we want to cast is "hello" and we try to cast it to bit. Is there any way to...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
Roger, I disagree with your definition of the repository pattern. I don't believe you inherently break away from using repository pattern simply by allowing deferred queries. I do, agree that using...
View ArticleNew Post: Mocking DbSet throws ArgumentNullException for 'source' argument...
I've been following this, and wanted to chime in. Things are getting a little off track, onto the repository pattern war. Just look around the internet and you can find oodles of people on both sides...
View ArticleNew Post: Support SQL Server HierarchyId data type
Hi, guys! Can anybody tell me, please, how to make this fork works? I have install it via NuGet Package Manager Console (using Install-Package EntityFrameworkWithHierarchyId -Version 6.0.2 command)....
View ArticleNew Post: ConditionalMigrations
Hi! In many scenarios a dev using EF Migrations might need write some conditional migrations. Here, some use cases: Migration to enable change tracking on sql server but only on RELEASE condition and...
View ArticleNew Post: Support SQL Server HierarchyId data type
Hi, In the nuget package you can find only the entityframework dlls, the tools which you try to use in VS is the original EF tools. It not supports hierarchyid. So you can do the following: remove...
View ArticleNew Post: Support SQL Server HierarchyId data type
Thank you, zgabi! I'll try solution, you offered!
View ArticleNew Post: Support SQL Server HierarchyId data type
zgabi wrote: Hi, In the nuget package you can find only the entityframework dlls, the tools which you try to use in VS is the original EF tools. It not supports hierarchyid. So you can do the...
View Article