public async Task<ActivityDto> PutActivity(ActivityDto activityDto) { var activity = new Activity(); activity.InjectFrom(activityDto); activity.Active = true; await _activityOperations.Create(activity); var result = new ActivityDto(); result.InjectFrom(activity); return result; }
public async Task Update(Activity activity) { _session.Entry(activity).Property(u => u.Active).IsModified = true; _session.Entry(activity).Property(u => u.ActivityDescription).IsModified = true; await _session.SaveChangesAsync(); }
public async Task Create(Activity activity) { _session.Activities.Add(activity); await _session.SaveChangesAsync(); }