public User(string name, string username, string password, Property favoriteProperty) { Name = name; Username = username; Password = password; FavoriteProperty = favoriteProperty; Properties = new List<Property>(); }
public Property Build() { if (string.IsNullOrEmpty(_name)) _name = "Nova Property"; var property = new Property(_name) {Id = _id}; return property; }
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); }
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}; }
public AccountBuilder WithProperty(Property property) { _property = property; return this; }
private void ValidateProperty(Property newProperty) { if (newProperty == null) throw new DomainException("Propriedade é obrigatória"); }
public void ChangeFavoriteProperty(Property newProperty) { ValidateProperty(newProperty); FavoriteProperty = newProperty; }
public void AddProperty(Property property) { Properties.Add(property); }
public UserBuilder WithProperty(Property property) { _favoriteProperty = property; return this; }
public CategoryBuilder WithProperty(Property property) { _property = property; return this; }