コード例 #1
0
        public static Account ToEntity(this AccountDto source)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new Account();

            // Properties
            target.Id                    = source.Id;
            target.IsActivated           = source.IsActivated;
            target.IsOpen                = source.IsOpen;
            target.ActivationDate        = source.ActivationDate;
            target.ActivationCode        = source.ActivationCode;
            target.BillingPlanExpiryDate = source.BillingPlanExpiryDate;

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

            return(target);
        }
コード例 #2
0
 static partial void OnEntityCreating(AccountDto source, Account target);
コード例 #3
0
 static partial void OnDtoCreating(Account source, AccountDto target);
コード例 #4
0
ファイル: Assetz.DTOs.cs プロジェクト: chriso86/assetz
 public UserDto(int id, string firstName, string lastName, string role, string email, string passwordSalt, int accountId, AccountDto account)
 {
     this.Id           = id;
     this.FirstName    = firstName;
     this.LastName     = lastName;
     this.Role         = role;
     this.Email        = email;
     this.PasswordSalt = passwordSalt;
     this.AccountId    = accountId;
     this.Account      = account;
 }
コード例 #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;
 }