public static EnumStatusTask Parser(this EnumStatusTask e, string stringToParser) { stringToParser = stringToParser?.Trim().ToUpper(); if (string.IsNullOrEmpty(stringToParser)) { return(EnumStatusTask.Unexpected); } EnumStatusTask resParser; if (Enum.TryParse(stringToParser, true, out resParser)) { return(resParser); } return(EnumStatusTask.Unexpected); }
public Task(Guid id, string title, string description, DateTime createdDate, EnumStatusTask status) { Id = id; Title = title; Description = description; Status = status; ModifiedDate = DateTime.Now; CreatedDate = createdDate; if (status == EnumStatusTask.Removed) { RemovedDate = DateTime.Now; } new AddNotifications <Task>(this).IfNullOrInvalidLength(x => x.Title, 5, 30); new AddNotifications <Task>(this).IfNullOrInvalidLength(x => x.Description, 10, 300); }
public List <Task> GetByStatus(EnumStatusTask status) { return(_repositoryTask.GetByStatus(status)); }
public List <Task> GetByStatus(EnumStatusTask status) { return(_context.Tasks.Where(x => x.Status == status).ToList()); }
public static bool IsOk(this EnumStatusTask e) { return(!EnumStatusTask.Unexpected.Equals(e)); }