public Member_Action Create(Member_ActionViewModel model) { var entity = new Member_Action(); entity.ActionType=model.ActionType; entity.MemberID=model.MemberID; entity.Description=model.Description; entity.IP=model.IP; entity.AddTime=model.AddTime; db.Add<Member_Action>(entity); db.Commit(); return entity; }
public Member_Action Update(Member_ActionViewModel model) { var entity = Find(model.ID); db.Attach<Member_Action>(entity); entity.ActionType=model.ActionType; entity.MemberID=model.MemberID; entity.Description=model.Description; entity.IP=model.IP; entity.AddTime=model.AddTime; db.Commit(); return entity; }