Пример #1
0
        public static WorkFilter GetWorkFilter(WorkFilterBindingModel model)
        {
            if (model == null)
            {
                return(null);
            }

            return(new WorkFilter
            {
                PageNumber = model.PageNumber,
                PageSize = model.PageSize,
                IsMatchAnyEnabled = model.MatchAny,
                Type = model.Type,
                AuthorId = model.AuthorId ?? Guid.Empty,
                LastName = model.LastName,
                Language = model.Language,
                Title = model.Title,
                ContainerId = model.ContainerId ?? Guid.Empty,
                Keyword = model.Keyword,
                YearPubMin = model.YearPubMin ?? 0,
                YearPubMax = model.YearPubMax ?? 0,
                Key = model.Key
            });
        }
Пример #2
0
 public ActionResult <DataPage <Container> > GetContainers(
     [FromQuery] WorkFilterBindingModel model)
 {
     return(Ok(_repository.GetContainers(
                   ModelHelper.GetWorkFilter(model))));
 }