예제 #1
0
        public static ContosoUniversity.DAL.SalesModel.Salon ToEntity(this SalonDto source)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new ContosoUniversity.DAL.SalesModel.Salon();

            // Properties
            target.ModelName       = source.ModelName;
            target.BrandId         = source.BrandId;
            target.ManufactureYear = source.ManufactureYear;
            target.Id          = source.Id;
            target.SalonType   = source.SalonType;
            target.description = source.description;

            // User-defined partial method
            OnEntityCreating(source, target);

            return(target);
        }
예제 #2
0
        public static SalonDto ToDtoWithRelated(this ContosoUniversity.DAL.SalesModel.Salon source, int level)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new SalonDto();

            // Properties
            target.ModelName       = source.ModelName;
            target.BrandId         = source.BrandId;
            target.ManufactureYear = source.ManufactureYear;
            target.Id          = source.Id;
            target.SalonType   = source.SalonType;
            target.description = source.description;

            // User-defined partial method
            OnDtoCreating(source, target);

            return(target);
        }
예제 #3
0
 static partial void OnEntityCreating(SalonDto source, ContosoUniversity.DAL.SalesModel.Salon target);
예제 #4
0
 public static SalonDto ToDto(this ContosoUniversity.DAL.SalesModel.Salon source)
 {
     return(source.ToDtoWithRelated(0));
 }
예제 #5
0
 static partial void OnDtoCreating(ContosoUniversity.DAL.SalesModel.Salon source, SalonDto target);