public Task <GtaplayerGarages> CreateGarageAsync(GtaplayerGarages objGtaplayerGarage) { try { _context.GtaplayerGarages.Add(objGtaplayerGarage); _context.SaveChanges(); } catch (System.Exception ex) { string myerror = ex.GetBaseException().ToString(); } return(Task.FromResult(objGtaplayerGarage)); }
public Task <bool> DeleteGarageAsync(GtaplayerGarages objGtaplayerGarage) { var ExistingGarage = _context.GtaplayerGarages .Where(x => x.Id == objGtaplayerGarage.Id) .FirstOrDefault(); if (ExistingGarage != null) { _context.GtaplayerGarages.Remove(ExistingGarage); _context.SaveChanges(); } else { return(Task.FromResult(false)); } return(Task.FromResult(true)); }