public bool Update(string Id, DmWeatherCheckT data) { var model = dbContext.DmWeatherCheckT.SingleOrDefault(x => x.WeatherCheckId == Id); if (model == null) { return(false); } model = data; dbContext.DmWeatherCheckT.Update(model); return(dbContext.SaveChanges() > 0); }
public bool Create(DmWeatherCheckT data) { data.WeatherCheckId = NormalHelper.GenerateNormalKey(); dbContext.DmWeatherCheckT.Add(data); return(dbContext.SaveChanges() > 0); }