public Activity CreateActivity(Activity activity) { using (var db = new CardsDb()) { db.Activities.Add(activity); db.SaveChanges(); return activity; } }
public static Activity Create(int cardId, int currentAreaId, CardChangeType changeType, string comments) { var db = DbFactory.Create(); var activity = new Activity() { CardID = cardId, CurrentAreaID = currentAreaId, ChangeType = changeType, Comment = comments, StampDate = DateProvider.UtcNow() }; return db.CreateActivity(activity); }