コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 static partial void OnEntityCreating(AssetTypeDto source, AssetType target);
コード例 #4
0
 static partial void OnDtoCreating(AssetType source, AssetTypeDto target);
コード例 #5
0
ファイル: Assetz.DTOs.cs プロジェクト: chriso86/assetz
 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;
 }