/// <summary>
        /// Se confirma que todos los objetos del modelo implementan la interface IObjectWithState
        /// </summary>
        /// <param name="context"></param>
        private static void CheckForEntitiesWithoutStateInterface(NWContext context)
        {
            var entitiesWithoutState =
                from e in context.ChangeTracker.Entries()
                where !(e.Entity is IObjectWithState)
                select e;

            if (entitiesWithoutState.Any())
            {
                throw new NotSupportedException("Todas la entidades deben implementar IObjectWithState.");
            }
        }
Exemple #2
0
 public BaseRepository(NWContext db)
 {
     _db = db;
 }
Exemple #3
0
 public CategoryRepository(NWContext context) : base(context)
 {
 }
 public CategoryD(NWContext db)
 {
     _db = db;
 }