public UI.UserDefinition GetOrCreateUser(string login) { var existingUser = DbEditorService.GetUserByLogin(login); if (existingUser == null) { var newDbUser = DbEditorService.CreateUser(new DAL.Models.User() { Login = login }); return(Mapper.Map <UI.UserDefinition>(newDbUser)); } else { return(Mapper.Map <UI.UserDefinition>(existingUser)); } }