Пример #1
0
        public virtual string Add(TEntity entity)
        {
            Result = context.Set <TEntity>().Add(entity).State.ToString();
            context.SaveChanges();

            return(Result);
        }
Пример #2
0
 public async Task <Machine> GetById(int id)
 {
     return(await _context.Set <Machine>().Include(p => p.MachineType).FirstAsync(i => i.Id == id));
 }
Пример #3
0
 public Task <T> GetById(int id)
 {
     return(_context.Set <T>().FindAsync(id));
 }
Пример #4
0
 public async Task <MachineType> GetById(int id)
 {
     return(await _context.Set <MachineType>().Include(mto => mto.machineTypeOperations).FirstOrDefaultAsync(e => e.Id == id));
 }
Пример #5
0
 public async Task <Tool> GetByName(string name)
 {
     return(await _context.Set <Tool>().FirstOrDefaultAsync(e => e.Name == name));
 }
Пример #6
0
 public async Task <Operation> GetById(int id)
 {
     return(await _context.Set <Operation>().Include(o => o.Tool).FirstOrDefaultAsync(o => o.Id == id));
 }
 public async Task <ProductionLine> GetById(int id)
 {
     return(await _context.Set <ProductionLine>().Include(m => m.Machines).FirstOrDefaultAsync(p => p.Id == id));
 }
Пример #8
0
 public async Task <MachineTypeOperation> GetById(int machineTypeId, int operationId)
 {
     return(await _context.Set <MachineTypeOperation>().FindAsync(machineTypeId, operationId));
 }