Top "Dbset" questions

Is DbSet<>.Local something to use with special care?

For a few days now, I have been struggling with retrieving my entities from a repository (DbContext). I am trying …

c# entity-framework dbcontext dbset
Converting an IQueryable<T> to a DbSet<T>

I'm not sure that this is possible, but I'm trying to unit test a repository that uses a DbSet. I …

c# unit-testing iqueryable dbset
Does converting from DbSet to IEnumerable cause the query to execute?

I have the following 2 methods in my Logs repository. public IEnumerable<Log> GetAll() { var db = new CasLogEntities(); return …

entity-framework dbset
DbSet.Cast<TEntity>() Error: Cannot create a DbSet<IEntity> from a non-generic DbSet for objects of type 'Entity'

Version Info: I am using C# 4.5, Entity Framework 6.0, and MEF. Code and Unit Test I created a Test Project to …

c# entity-framework casting mef dbset
DbSet.Add() not working

I have a class like this: [Table("member_activation")] public partial class MemberActivation { [Key] public Int64 member_id { get; set; } …

c# asp.net dbset