public Models.Comment Update(int id, Models.Comment entity) { try { entity = CommentDataProccessor.ValidationAndProcess(entity); entity.Id = id; DbEntities.ApplyCurrentValues("Comments", entity); DbEntities.SaveChanges(); return(entity); } catch { throw; } }
public Models.Comment Create(Models.Comment entity) { try { entity = CommentDataProccessor.ValidationAndProcess(entity); DbEntities.Comments.AddObject(entity); DbEntities.SaveChanges(); DbEntities.Refresh(System.Data.Objects.RefreshMode.StoreWins, entity); return(entity); } catch { throw; } }