public virtual string Add(TEntity entity) { Result = context.Set <TEntity>().Add(entity).State.ToString(); context.SaveChanges(); return(Result); }
public async Task <Machine> GetById(int id) { return(await _context.Set <Machine>().Include(p => p.MachineType).FirstAsync(i => i.Id == id)); }
public Task <T> GetById(int id) { return(_context.Set <T>().FindAsync(id)); }
public async Task <MachineType> GetById(int id) { return(await _context.Set <MachineType>().Include(mto => mto.machineTypeOperations).FirstOrDefaultAsync(e => e.Id == id)); }
public async Task <Tool> GetByName(string name) { return(await _context.Set <Tool>().FirstOrDefaultAsync(e => e.Name == name)); }
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)); }
public async Task <MachineTypeOperation> GetById(int machineTypeId, int operationId) { return(await _context.Set <MachineTypeOperation>().FindAsync(machineTypeId, operationId)); }