示例#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
        public Property Build()
        {
            if (string.IsNullOrEmpty(_name))
                _name = "Nova Property";

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

            return property;
        }
示例#3
0
        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
        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
 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
 public UserBuilder WithProperty(Property property)
 {
     _favoriteProperty = property;
     return this;
 }
示例#10
0
 public CategoryBuilder WithProperty(Property property)
 {
     _property = property;
     return this;
 }