public TeamDetailModel Add(TeamDetailModel detail) { using (var teamCommunicationDbContext = dbContextFactory.CreateDbContext()) { var team = TeamMapper.MapTeamDetailModelToEntity(detail); team.Id = Guid.NewGuid(); teamCommunicationDbContext.Teams.Add(team); teamCommunicationDbContext.SaveChanges(); return(TeamMapper.MapTeamEntityToDetailModel(team)); } }