public Models.Review Create(Models.Review entity) { try { entity = NewsDataProccessor.ValidationAndProcess(entity); DbEntities.Reviews.AddObject(entity); DbEntities.SaveChanges(); DbEntities.Refresh(System.Data.Objects.RefreshMode.StoreWins, entity); return(Read(entity.Id)); } catch { throw; } }
public Models.Review Update(int id, Models.Review entity) { try { entity = NewsDataProccessor.ValidationAndProcess(entity); entity.Id = id; string oldRatedAspects = entity.RatedAspects; DbEntities.ApplyCurrentValues("Reviews", entity); DbEntities.SaveChanges(); return(Read(entity.Id)); } catch { throw; } }