public void UomQueryContainsWithUpperCase() { var u = session.Load <Uom>(IntToGuid <Uom>(1)); var res = UomQuery.Contains(session)(u.Abbr.ToUpper()); Assert.IsTrue(res.Contains(u)); }
public async Task <IEnumerable <Uom> > GetAllAsync() { using (var connection = context.CreateConnection()) { return(await connection.QueryAsync <Uom>(UomQuery.All())); } }
public async Task DeleteAsync(Guid id) { using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(UomQuery.Delete(id)); } }
public void UomQueryByAbbrAndType() { var u = session.Load <Uom>(IntToGuid <Uom>(1)); var res = UomQuery.ByAbbrDescrAndTypeName(session)(u.Abbr, u.Description, u.Type.Title); Assert.AreEqual(u, res); }
public async Task <Uom> GetByIdAsync(Guid id) { using (var connection = context.CreateConnection()) { var query = await connection.QueryAsync <Uom>(UomQuery.ById(id)); return(query.SingleOrDefault()); } }
public async Task <Uom> UpdateAsync(Uom uom) { using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(UomQuery.Update(uom)); return(uom); } }
public async Task <Uom> GetAsync(Guid id) { var query = new UomQuery { FilterIds = id.Collect() }; // query.AsLazy(); return((await _queryInvoker.Execute <UomQuery, Uom>(query)).SingleOrDefault()); }
public Uom Create(Uom uom) { if (uom.Id == Guid.Empty) { uom.Id = Guid.NewGuid(); } using (var connection = context.CreateConnection()) { connection.Execute(UomQuery.Insert(uom)); return(uom); } }
public async Task <Uom> CreateAsync(Uom uom) { if (uom.Id == Guid.Empty) { uom.Id = Guid.NewGuid(); } using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(UomQuery.Insert(uom)); return(uom); } }
private List <Uom> LoadUoms(SearchOptionsDTO dto, ISession session, out bool uomsMissed) { var uomSpecs = dto.MeasuresAll .Union(dto.MeasuresAny) .Where(x => x.UomDescr != null) .Select(x => new { Abbr = x.Abbr, Descr = x.UomDescr, TypeName = x.UomTypeTitle == null ? null : x.UomTypeTitle }) .Distinct() .ToList(); var uoms = uomSpecs .Select(x => UomQuery.ByAbbrDescrAndTypeName(session)(x.Abbr, x.Descr, x.TypeName)) .Where(x => x != null) .ToList(); uomsMissed = uomSpecs.Count != uoms.Count; return(uoms); }
public async Task <IEnumerable <Uom> > GetAsync([FromQuery] string nameLike, [FromQuery] UomType?typeExact, int?take, int?skip, string orderBy, string orderMode) { var query = new UomQuery { Take = take, Skip = skip, OrderBy = orderBy, OrderMode = orderMode, FilterNameLike = nameLike, FilterTypeExact = typeExact }; // query.AsLazy(); return(await _queryInvoker.Execute <UomQuery, Uom>(query)); }
public MeasureEditorViewModel(Measure measure, Word w, bool withCompare) { this.withCompare = withCompare; _uoms = new List <Uom> { Uom.Null }; var allUoms = UomQuery.Contains(Session)(""); _uoms.AddRange(allUoms); var view = (ListCollectionView)CollectionViewSource.GetDefaultView(_uoms); view.GroupDescriptions.Add(new PropertyGroupDescription("Type")); Operator = MeasureOperator.Equal; SetupMeasure(measure, w); CreateAutocomplete(); Title = "Редактирование измерения"; HelpTopic = "editmeasure"; WithHelpButton = false; }
private void CreateFilter() { _filter = new FilterViewModel <Uom>(UomQuery.Contains(Session)); }