public Agent Create(AgentModel model) { return(new Agent() { Id = model.Id, Name = model.Name, Username = model.Username }); }
public Agent Create(AgentModel model) { return(new Agent() { Id = model.Id, Name = model.Name, Username = model.Name.Split(' ')[0].ToLower(), Towns = model.Towns.Select(x => _unitOfWork.Towns.Get(x.Id)).ToList() }); }