コード例 #1
0
ファイル: User.cs プロジェクト: essgineer/Finance
        public User(string name, string username, string password, Property favoriteProperty)
        {
            Name = name;
            Username = username;
            Password = password;
            FavoriteProperty = favoriteProperty;

            Properties = new List<Property>();
        }
コード例 #2
0
ファイル: PropertyBuilder.cs プロジェクト: essgineer/Finance
        public Property Build()
        {
            if (string.IsNullOrEmpty(_name))
                _name = "Nova Property";

            var property = new Property(_name) {Id = _id};

            return property;
        }
コード例 #3
0
ファイル: AccountBuilder.cs プロジェクト: essgineer/Finance
        public Account Build()
        {
            if (_property == null)
                _property = new Property("Nova Propriedade Da Conta"){Id = _id};

            if (string.IsNullOrEmpty(_name))
                _name = "Nova Conta";

            return new Account(_name, _property);
        }
コード例 #4
0
ファイル: CategoryBuilder.cs プロジェクト: essgineer/Finance
        public Category Build()
        {
            if (_property == null)
                _property = PropertyBuilder.AProperty().Build();

            if (string.IsNullOrEmpty(_name))
                _name = "Nome da categoria";

            return new Category(_name,_property, _type){Id = _id};
        }
コード例 #5
0
ファイル: AccountBuilder.cs プロジェクト: essgineer/Finance
 public AccountBuilder WithProperty(Property property)
 {
     _property = property;
     return this;
 }
コード例 #6
0
ファイル: User.cs プロジェクト: essgineer/Finance
 private void ValidateProperty(Property newProperty)
 {
     if (newProperty == null)
         throw new DomainException("Propriedade é obrigatória");
 }
コード例 #7
0
ファイル: User.cs プロジェクト: essgineer/Finance
        public void ChangeFavoriteProperty(Property newProperty)
        {
            ValidateProperty(newProperty);

            FavoriteProperty = newProperty;
        }
コード例 #8
0
ファイル: User.cs プロジェクト: essgineer/Finance
 public void AddProperty(Property property)
 {
     Properties.Add(property);
 }
コード例 #9
0
ファイル: UserBuilder.cs プロジェクト: essgineer/Finance
 public UserBuilder WithProperty(Property property)
 {
     _favoriteProperty = property;
     return this;
 }
コード例 #10
0
ファイル: CategoryBuilder.cs プロジェクト: essgineer/Finance
 public CategoryBuilder WithProperty(Property property)
 {
     _property = property;
     return this;
 }