public virtual ApiAdminServerResponseModel MapEntityToModel( Admin item) { var model = new ApiAdminServerResponseModel(); model.SetProperties(item.Id, item.Birthday, item.Email, item.FirstName, item.LastName, item.Phone, item.UserId); if (item.UserIdNavigation != null) { var userIdModel = new ApiUserServerResponseModel(); userIdModel.SetProperties( item.UserIdNavigation.Id, item.UserIdNavigation.Password, item.UserIdNavigation.Username); model.SetUserIdNavigation(userIdModel); } return(model); }
public virtual ApiUserServerResponseModel MapEntityToModel( User item) { var model = new ApiUserServerResponseModel(); model.SetProperties(item.Id, item.Password, item.Username); return(model); }
public virtual ApiUserServerResponseModel MapServerRequestToResponse( int id, ApiUserServerRequestModel request) { var response = new ApiUserServerResponseModel(); response.SetProperties(id, request.Password, request.Username); return(response); }
public virtual ApiStudentServerResponseModel MapEntityToModel( Student item) { var model = new ApiStudentServerResponseModel(); model.SetProperties(item.Id, item.Birthday, item.Email, item.EmailRemindersEnabled, item.FamilyId, item.FirstName, item.IsAdult, item.LastName, item.Phone, item.SmsRemindersEnabled, item.UserId); if (item.FamilyIdNavigation != null) { var familyIdModel = new ApiFamilyServerResponseModel(); familyIdModel.SetProperties( item.FamilyIdNavigation.Id, item.FamilyIdNavigation.Notes, item.FamilyIdNavigation.PrimaryContactEmail, item.FamilyIdNavigation.PrimaryContactFirstName, item.FamilyIdNavigation.PrimaryContactLastName, item.FamilyIdNavigation.PrimaryContactPhone); model.SetFamilyIdNavigation(familyIdModel); } if (item.UserIdNavigation != null) { var userIdModel = new ApiUserServerResponseModel(); userIdModel.SetProperties( item.UserIdNavigation.Id, item.UserIdNavigation.Password, item.UserIdNavigation.Username); model.SetUserIdNavigation(userIdModel); } return(model); }