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); }
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); }
static partial void OnEntityCreating(PublisherDto source, ContosoUniversity.DAL.SalesModel.Publisher target);
public static PublisherDto ToDto(this ContosoUniversity.DAL.SalesModel.Publisher source) { return(source.ToDtoWithRelated(0)); }
static partial void OnDtoCreating(ContosoUniversity.DAL.SalesModel.Publisher source, PublisherDto target);