예제 #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));
 }