コード例 #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);