public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } Book.SegmentIdsString = string.Join(",", SegmentOptions.OrderBy(item => item.Order).Where(item => item.Checked).Select(item => item.Id)); Book.Owner = Globals.CURRENT_USER; _context.Book.Add(Book); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public Task <Operation <IStream <TObject> > > GetAsync(SegmentOptions segment, FieldOptions fields = null, FilterOptions filter = null, ProjectionOptions projection = null) { _db.SetTypeInfo(typeof(TObject)); throw new NotImplementedException("Segmentation not available."); }
public static Dictionary <string, Segment> GetSegments(Account account, Channel channel, SqlConnection connection, SegmentOptions options, OptionsOperator @operator = OptionsOperator.And) { return(new Dictionary <string, Segment>() { { Common.Campaign, new Segment() { ID = -875, Name = Common.Campaign } }, { Common.AdGroup, new Segment() { ID = -876, Name = Common.AdGroup } }, { Common.Tracker, new Segment() { ID = -977, Name = Common.Tracker } }, { Common.LandingPage, new Segment() { ID = -823, Name = Common.LandingPage } }, { Common.USP, new Segment() { ID = -824, Name = Common.USP } }, { Common.Region, new Segment() { ID = -825, Name = Common.Region } }, { Common.Language, new Segment() { ID = -826, Name = Common.Language } }, { Common.Theme, new Segment() { ID = -827, Name = Common.Theme } }, }); }
public virtual Task <Operation> DeleteAsync(SegmentOptions segment) { _db.SetTypeInfo(typeof(TObject)); throw new NotImplementedException("Segmentation not available."); }
public static Dictionary <string, Segment> GetSegments(Account account, Channel channel, SqlConnection connection, SegmentOptions options, OptionsOperator @operator = OptionsOperator.And) { return(new Dictionary <string, Segment>() { { Common.Campaign, new Segment() { ID = -875, Name = Common.Campaign } }, { Common.AdGroup, new Segment() { ID = -876, Name = Common.AdGroup } }, { Common.Tracker, new Segment() { ID = -977, Name = Common.Tracker } } }); }
public async Task <IActionResult> GetAsync(SortOptions sort, PageOptions page, StreamOptions stream, FieldOptions fields, FilterOptions filter, ProjectionOptions projection, SegmentOptions segment, [FromQuery] string query = null) { // ReSharper disable once PossibleMultipleEnumeration if (segment.Ids != null && (segment.Count > 0 || segment.Ids.Any())) { // ReSharper disable once PossibleMultipleEnumeration var slice = await _repository.GetAsync(segment, fields, filter, projection); Response.MaybeEnvelope(Request, _apiOptions.CurrentValue.JsonConversion, slice?.Data, slice?.Errors, out var body); return(Ok(body)); } else { var slice = await _repository.GetAsync(query, sort, page, fields, filter, projection); Response.MaybeEnvelope(Request, _apiOptions.CurrentValue.JsonConversion, slice?.Data, slice?.Errors, out var body); return(Ok(body)); } }