public static AssetTypeDto ToDtoWithRelated(this AssetType source, int level) { if (source == null) { return(null); } var target = new AssetTypeDto(); // Properties target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.Code = source.Code; target.Image = source.Image; // Navigation Properties if (level > 0) { target.Assets = source.Assets.ToDtosWithRelated(level - 1); } // User-defined partial method OnDtoCreating(source, target); return(target); }
public static AssetType ToEntity(this AssetTypeDto source) { if (source == null) { return(null); } var target = new AssetType(); // Properties target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.Code = source.Code; target.Image = source.Image; // User-defined partial method OnEntityCreating(source, target); return(target); }
static partial void OnEntityCreating(AssetTypeDto source, AssetType target);
static partial void OnDtoCreating(AssetType source, AssetTypeDto target);
public AssetDto(int id, string name, string description, int?usefulLifespan, string code, string digitalCode, System.DateTimeOffset?purchaseDate, decimal?purchasePrice, decimal salvageValue, string image, int assetTypeId, int accountId, decimal longitude, decimal latitude, AssetTypeDto assetType, AccountDto account, List <VerificationEntryDto> verificationEntries) { this.Id = id; this.Name = name; this.Description = description; this.UsefulLifespan = usefulLifespan; this.Code = code; this.DigitalCode = digitalCode; this.PurchaseDate = purchaseDate; this.PurchasePrice = purchasePrice; this.SalvageValue = salvageValue; this.Image = image; this.AssetTypeId = assetTypeId; this.AccountId = accountId; this.Longitude = longitude; this.Latitude = latitude; this.AssetType = assetType; this.Account = account; this.VerificationEntries = verificationEntries; }