예제 #1
0
 public async Task DeleteCropAcres(CropAcresModel cropAcre)
 {
     await Task.Run(() =>
     {
         if (_cropAcres.Contains(cropAcre.CropId))
         {
             _cropAcres.Remove(cropAcre.CropId);
         }
         return(null);
     });
 }
예제 #2
0
        public async Task <CropAcresModel> PostCropAcres(CropAcresModel cropAcre)
        {
            var task = await Task.Run(() =>
            {
                if (!_cropAcres.Contains(cropAcre.CropId))
                {
                    _cropAcres[cropAcre.CropId] = cropAcre;
                    return(_cropAcres[cropAcre.CropId] as CropAcresModel);
                }
                return(null);
            });

            return(task);
        }