public async Task <Guid> CreateAsync(EntityModels.Account account) { if (account is null) { throw new ArgumentNullException(nameof(account)); } account.Id = Guid.NewGuid(); using (var connection = OpenConnection()) { await connection.InsertAsync(account); return(account.Id); } }
private ProjectionModels.Comment MapEntitiesIntoProjection(EntityModels.Comment comment, EntityModels.Account account) { var projection = mapper.Map <ProjectionModels.Comment>(comment); projection.Creator = mapper.Map <ProjectionModels.Account>(account); return(projection); }
private ProjectionModels.Post MapEntitiesIntoProjection(EntityModels.Post post, EntityModels.Account account) { var projection = mapper.Map <ProjectionModels.Post>(post); projection.Creator = mapper.Map <ProjectionModels.Account>(account); return(projection); }
public async Task <ProjectionModels.Account> CreateAsync(EntityModels.Account account) { var createdAccount = await accountRepository.CreateAsync(account); return(mapper.Map <ProjectionModels.Account>(createdAccount)); }