public Command Get(Expression <Func <Command, bool> > where) { using (var ctx = new DatabContext()) { return(ctx.Commands.Where(where).Include(x => x.product).FirstOrDefault()); } }
public Admin GetById(string id) { using (var ctx = new DatabContext()) { return(ctx.Admins.Find(id)); } }
public Command GetById(long id) { using (var ctx = new DatabContext()) { return(ctx.Commands.Include(x => x.product).Where(w => w.idcmd == id).FirstOrDefault()); } }
public Command GetById(string id) { using (var ctx = new DatabContext()) { return(ctx.Commands.Find(id)); } }
public Admin Get(Expression <Func <Admin, bool> > where) { using (var ctx = new DatabContext()) { return(ctx.Admins.Where(where).FirstOrDefault()); } }
public IEnumerable <Admin> GetAll() { using (var ctx = new DatabContext()) { return(ctx.Admins); } }
public IEnumerable <Claim> GetAll() { using (var ctx = new DatabContext()) { return(ctx.Claims.AsEnumerable()); } }
public Claim GetById(string id) { using (var ctx = new DatabContext()) { return(ctx.Claims.Find(id)); } }
public Claim Get(Expression <Func <Claim, bool> > where) { using (var ctx = new DatabContext()) { return(ctx.Claims.Where(where).FirstOrDefault()); } }
public void Commit() { using (var ctx = new DatabContext()) { ctx.SaveChanges(); } }
public IEnumerable <Command> GetAll() { using (var ctx = new DatabContext()) { return(ctx.Commands.Include(x => x.product).AsEnumerable()); } }
public void Add(Claim entity) { using (var ctx = new DatabContext()) { ctx.Claims.Add(entity); ctx.SaveChanges(); } }
public void Add(Admin entity) { using (var ctx = new DatabContext()) { ctx.Admins.Add(entity); ctx.SaveChanges(); } }
/**************************************************************/ public void Add(Command entity) { using (var ctx = new DatabContext()) { ctx.Commands.Add(entity); ctx.SaveChanges(); } }
public void Delete(Claim entity) { using (var ctx = new DatabContext()) { ctx.Claims.Remove(entity); ctx.SaveChanges(); } }
public void Delete(Admin entity) { using (var ctx = new DatabContext()) { ctx.Admins.Remove(entity); ctx.SaveChanges(); } }
public void Delete(Command entity) { using (var ctx = new DatabContext()) { ctx.Commands.Attach(entity); ctx.Commands.Remove(entity); ctx.SaveChanges(); } }
public void Update(Command entity) { using (var ctx = new DatabContext()) { ctx.Commands.Attach(entity); ctx.Entry(entity).State = EntityState.Modified; ctx.SaveChanges(); } }
public void Delete(Expression <Func <Admin, bool> > where) { using (var ctx = new DatabContext()) { IEnumerable <Admin> objects = ctx.Admins.Where(where).AsEnumerable(); foreach (Admin obj in objects) { ctx.Admins.Remove(obj); } ctx.SaveChanges(); } }
public void Delete(Expression <Func <Claim, bool> > where) { IEnumerable <Claim> objects; using (var ctx = new DatabContext()) { objects = ctx.Claims.Where(where).AsEnumerable(); foreach (Claim obj in objects) { ctx.Claims.Remove(obj); } ctx.SaveChanges(); } }
public void Delete(Expression <Func <Command, bool> > where) { IEnumerable <Command> objects; using (var ctx = new DatabContext()) { objects = ctx.Commands.Where(where).AsEnumerable(); ctx.Commands.RemoveRange(objects); ctx.SaveChanges(); } }
public IEnumerable <Admin> GetMany(Expression <Func <Admin, bool> > where = null, Expression <Func <Admin, bool> > orderBy = null) { IQueryable <Admin> Query; using (var ctx = new DatabContext()) { Query = ctx.Admins; if (where != null) { Query = Query.Where(where); } if (orderBy != null) { Query = Query.OrderBy(orderBy); } return(Query.ToList()); } }
public IEnumerable <Command> GetMany(Expression <Func <Command, bool> > where = null, Expression <Func <Command, bool> > orderBy = null) { IQueryable <Command> Query; using (var ctx = new DatabContext()) { Query = ctx.Commands.Include(x => x.product); if (where != null) { Query = Query.Where(where); } if (orderBy != null) { Query = Query.OrderBy(orderBy); } return(Query.ToList()); } }
public UnitOfWork(IDatabaseFactory dbFactory) { this.dbFactory = dbFactory; dataContext = dbFactory.DataContext; }
public DatabaseFactory() { dataContext = new DatabContext(); }
public TodoItemsController(DatabContext context) { _context = context; }
public Rps_Game(ILogger <Rps_Game> logger, IMemoryCache cache, DatabContext context) { _logger = logger; _cache = cache; _context = context; }