예제 #1
0
        public VenueSearchResultModel(
            IEnumerable <VenueSearchResultItemModel> items,
            VenueSearchResultItemModel deletedItem)
        {
            if (items == null)
            {
                throw new ArgumentNullException(nameof(items));
            }

            Errors  = new string[] { };
            NewItem = deletedItem;
            Deleted = true;
            Items   = items;
        }
예제 #2
0
        public VenueSearchResultModel(
            string searchTerm,
            IEnumerable<VenueSearchResultItemModel> items,
            VenueSearchResultItemModel newItem,
            bool updated)
        {
            Throw.IfNullOrWhiteSpace(searchTerm, nameof(searchTerm));
            Throw.IfNull(items, nameof(items));

            Errors = new string[] { };
            SearchTerm = searchTerm;
            NewItem = newItem;
            Items = items;
            Updated = updated;
        }
예제 #3
0
        public VenueSearchResultModel(
            string searchTerm,
            IEnumerable <VenueSearchResultItemModel> items,
            VenueSearchResultItemModel newItem,
            bool updated)
        {
            if (string.IsNullOrWhiteSpace(searchTerm))
            {
                throw new ArgumentNullException($"{nameof(searchTerm)} cannot be null or empty or whitespace.", nameof(searchTerm));
            }

            if (items == null)
            {
                throw new ArgumentNullException(nameof(items));
            }

            Errors     = new string[] { };
            SearchTerm = searchTerm;
            NewItem    = newItem;
            Items      = items;
            Updated    = updated;
        }