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

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

            // Properties
            target.ModelName       = source.ModelName;
            target.BrandId         = source.BrandId;
            target.ManufactureYear = source.ManufactureYear;
            target.Id      = source.Id;
            target.SuvType = source.SuvType;

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

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

            var target = new SUVDto();

            // Properties
            target.ModelName       = source.ModelName;
            target.BrandId         = source.BrandId;
            target.ManufactureYear = source.ManufactureYear;
            target.Id      = source.Id;
            target.SuvType = source.SuvType;

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

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