Exemple #1
0
        public async Task <SimpleResult> AddWarehouse(WarehousePoco input)
        {
            await _context.Warehouses.AddAsync(input);

            await _context.SaveChangesAsync();

            return(new SimpleResult
            {
                IsSuccess = true
            });
        }
Exemple #2
0
 public async Task <SimpleResult> AddWarehouse(AddWarehouseInput input)
 {
     try
     {
         var poco = new WarehousePoco
         {
             Name   = input.Name,
             UserId = input.UserId
         };
         return(await _warehouse.AddWarehouse(poco));
     }
     catch
     {
         return(new SimpleResult
         {
             IsSuccess = false
         });
     }
 }