BlueCollar.Dashboard.Models.HomeIndex.Fill C# (CSharp) Method

Fill() public method

Fills the model with data.
public Fill ( IRepository repository, ModelStateDictionary modelState ) : bool
repository IRepository The repository to use.
modelState ModelStateDictionary The model state dictionary to add errors to.
return bool
        public override bool Fill(IRepository repository, ModelStateDictionary modelState)
        {
            if (repository == null)
            {
                throw new ArgumentNullException("repository", "repository cannot be null.");
            }

            bool success = base.Fill(repository, modelState);

            if (success)
            {
                this.CountsJson = JsonConvert.SerializeObject(repository.GetCounts(BlueCollarSection.Section.ApplicationName, null));
            }

            return success;
        }
HomeIndex