/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="TypeCodeDTO"/> converted from <see cref="JobsInABA.DAL.Entities.TypeCode"/>.</param> static partial void OnDTO(this JobsInABA.DAL.Entities.TypeCode entity, TypeCodeDTO dto) { if (entity.ClassType != null) { dto.ClassType = ClassTypeAssembler.ToDTO(entity.ClassType); } }
/// <summary> /// Converts this instance of <see cref="TypeCode"/> to an instance of <see cref="TypeCodeDTO"/>. /// </summary> /// <param name="entity"><see cref="TypeCode"/> to convert.</param> public static TypeCodeDTO ToDTO(this JobsInABA.DAL.Entities.TypeCode entity) { if (entity == null) { return(null); } var dto = new TypeCodeDTO(); dto.TypeCodeID = entity.TypeCodeID; dto.Name = entity.Name; dto.Code = entity.Code; dto.Description = entity.Description; dto.ClassTypeID = entity.ClassTypeID; dto.ParentTypeCodeID = entity.ParentTypeCodeID; entity.OnDTO(dto); return(dto); }
/// <summary> /// Converts this instance of <see cref="TypeCodeDTO"/> to an instance of <see cref="TypeCode"/>. /// </summary> /// <param name="dto"><see cref="TypeCodeDTO"/> to convert.</param> public static JobsInABA.DAL.Entities.TypeCode ToEntity(this TypeCodeDTO dto) { if (dto == null) { return(null); } var entity = new JobsInABA.DAL.Entities.TypeCode(); entity.TypeCodeID = dto.TypeCodeID; entity.Name = dto.Name; entity.Code = dto.Code; entity.Description = dto.Description; entity.ClassTypeID = dto.ClassTypeID; entity.ParentTypeCodeID = dto.ParentTypeCodeID; dto.OnEntity(entity); return(entity); }
public static AddressDataModel ToDataModel(AddressDTO dto) { AddressDataModel datamodel = new AddressDataModel(); if (dto != null) { datamodel.AddressID = dto.AddressID; datamodel.Title = dto.Title; datamodel.Line1 = dto.Line1; datamodel.Line2 = dto.Line2; datamodel.Line3 = dto.Line3; datamodel.City = dto.City; datamodel.State = dto.State; datamodel.ZipCode = dto.ZipCode; datamodel.AddressTypeID = dto.AddressTypeID; } if (dto.Country != null) { CountryDTO countrydto = dto.Country; datamodel.CountryID = countrydto.CountryID; datamodel.AddressCountryAbbreviation = countrydto.Abbreviation; datamodel.AddressCountryCode = countrydto.Code; datamodel.AddressCountryName = countrydto.Name; datamodel.AddressCountryPhoneCode = countrydto.PhoneCode; } if (dto.TypeCode != null) { TypeCodeDTO typecodedto = dto.TypeCode; datamodel.AddressTypeID = typecodedto.TypeCodeID; datamodel.AddressTypeCode = typecodedto.Code; datamodel.AddressTypeCodeClassTypeID = typecodedto.ClassTypeID; datamodel.AddressTypeCodeDescription = typecodedto.Description; datamodel.AddressTypeCodeName = typecodedto.Name; datamodel.AddressTypeCodeParentTypeCodeID = typecodedto.ParentTypeCodeID; } return(datamodel); }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="JobsInABA.DAL.Entities.TypeCode"/> converted from <see cref="TypeCodeDTO"/>.</param> static partial void OnEntity(this TypeCodeDTO dto, JobsInABA.DAL.Entities.TypeCode entity) { }
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="TypeCodeDTO"/> converted from <see cref="TypeCode"/>.</param> static partial void OnDTO(this JobsInABA.DAL.Entities.TypeCode entity, TypeCodeDTO dto);