public Work Update(Work work) { _databasecontext.Entry(work).State = EntityState.Modified; _databasecontext.SaveChanges(); return work; }
public Work Add(Work work) { _databasecontext.Works.Add(work); _databasecontext.SaveChanges(); return work; }
public WorkViewModel(int id) { _work = new WorkBl().GetById(int.Parse(id.ToString())); if (_work.UserId != Assets.CurrentUser.Id) { _work = new Work(); } }
public void Delete(Work work) { _databasecontext.Works.Remove(work); _databasecontext.SaveChanges(); }
public WorkViewModel() { _work = new Work(); }