示例#1
0
        public async Task Update(User.Aggregate aggregate)
        {
            var dto = new Dtos.User();

            dto.Populate(aggregate.State);

            await database.UpdateAsync(dto);
        }
示例#2
0
        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));
        }