public async Task DeleteCropAcres(CropAcresModel cropAcre) { await Task.Run(() => { if (_cropAcres.Contains(cropAcre.CropId)) { _cropAcres.Remove(cropAcre.CropId); } return(null); }); }
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); }