示例#1
0
        public static ContosoUniversity.DAL.SalesModel.Publisher ToEntity(this PublisherDto source)
        {
            if (source == null)
            {
                return(null);
            }

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

            // Properties
            target.Id   = source.Id;
            target.Name = source.Name;

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

            return(target);
        }
示例#2
0
        public static PublisherDto ToDtoWithRelated(this ContosoUniversity.DAL.SalesModel.Publisher source, int level)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new PublisherDto();

            // Properties
            target.Id   = source.Id;
            target.Name = source.Name;

            // Navigation Properties
            if (level > 0)
            {
                target.Books = source.Books.ToDtosWithRelated(level - 1);
            }

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

            return(target);
        }
 public BookDto(decimal?price, global::System.DateTime?rowVersion, string category, string enDescription, string arDescription, long id, string iSBN, int?publisherId, ContosoUniversity.DAL.SalesModel.BookLangauge langauge, PublisherDto publisher, List <AuthorDto> authors)
 {
     this.Price         = price;
     this.RowVersion    = rowVersion;
     this.Category      = category;
     this.EnDescription = enDescription;
     this.ArDescription = arDescription;
     this.Id            = id;
     this.ISBN          = iSBN;
     this.PublisherId   = publisherId;
     this.Langauge      = langauge;
     this.Publisher     = publisher;
     this.Authors       = authors;
 }
示例#4
0
 static partial void OnEntityCreating(PublisherDto source, ContosoUniversity.DAL.SalesModel.Publisher target);
示例#5
0
 static partial void OnDtoCreating(ContosoUniversity.DAL.SalesModel.Publisher source, PublisherDto target);