allanwalpy / 01-19-vacancy-task-1

some simple task implementation, nothing to see
MIT License
0 stars 0 forks source link

Simplify `VacancyUpdateModel` #21

Closed allanwalpy closed 5 years ago

allanwalpy commented 5 years ago

It is now:

public class VacancyUpdateModel
{
    [ValidUpdateField(typeof(ValidVacancyTitleAttribute))]
    public UpdateCommandModel<string> Title { get; set; }

    [ValidUpdateField(typeof(ValidVacancyDescriptionAttribute))]
    public UpdateCommandModel<string> Description { get; set; }

    [ValidUpdateField(typeof(ValidEmploymentTypeListAttribute))]
    public UpdateCommandModel<List<string>> EmploymentType { get; set; }

    [ValidUpdateField(typeof(ValidSalaryAttribute))]
    public UpdateCommandModel<decimal?> Salary { get; set; }

    public UpdateCommandModel<Person> ContactPerson { get; set; }

    [ValidUpdateField(typeof(ValidPhoneNumberAttribute))]
    public UpdateCommandModel<string> ContactPhone { get; set; }
}

suggestion: if there is no field with such name or it is null (questionable) - do not set it;

allanwalpy commented 5 years ago

nah