public async Task Update(User.Aggregate aggregate) { var dto = new Dtos.User(); dto.Populate(aggregate.State); await database.UpdateAsync(dto); }
public async Task <User.Aggregate> Insert(User.Aggregate aggregate) { var dto = new Dtos.User(); dto.Populate(aggregate.State); dto.Id = (long)await database.InsertAsync(dto); var state = dto.Map(); state.HasNewIdentity = true; return(new User.Aggregate(state)); }