This commit is contained in:
dasha 2023-05-11 12:44:31 +04:00
parent 80afc49285
commit ad38f7d6f5
2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ namespace BeautySaloonNoSQLDatabaseImplement
public int Id { get; set; } public int Id { get; set; }
[BsonElement("date")] [BsonElement("date")]
private DateTime DateMongo { get; set; } public DateTime DateMongo { get; set; }
[BsonIgnore] [BsonIgnore]
public DateOnly Date { public DateOnly Date {
get get

View File

@ -233,18 +233,18 @@ namespace BeautySaloonView
}*/ }*/
//var result = _OLogic.ReadList(null)?.OrderByDescending(x => x.Date).OrderBy(x => x.Sum).ToList(); //var result = _OLogic.ReadList(null)?.OrderByDescending(x => x.Date).OrderBy(x => x.Sum).ToList();
var source = MongoDBContext.GetInstance(); var source = MongoDBContext.GetInstance();
var users = (from o in source.Orders.AsQueryable() var users = (from o in source.Orders.Find(new BsonDocument()).ToList().AsQueryable()
join c in source.Clients.AsQueryable() on o.ClientId equals c.Id join c in source.Clients.Find(new BsonDocument()).ToList().AsQueryable() on o.ClientId equals c.Id
join em in source.Employees.AsQueryable() on o.EmployeeId equals em.Id join em in source.Employees.Find(new BsonDocument()).ToList().AsQueryable() on o.EmployeeId equals em.Id
where em.PositionName == "Продавец" where em.PositionName == "Продавец"
orderby o.Date descending, o.Sum descending orderby o.DateMongo descending, o.Sum descending
select new select new
{ {
Id = o.Id, Id = o.Id,
Client = c.Name + ' ' + c.Surname + ' ' + c.Patronymic, Client = c.Name + ' ' + c.Surname + ' ' + c.Patronymic,
Seller = em.Name + ' ' + em.Surname + ' ' + em.Patronymic, Seller = em.Name + ' ' + em.Surname + ' ' + em.Patronymic,
Position = em.PositionName, Position = em.PositionName,
Date = o.Date, Date = o.DateMongo,
Sum = o.Sum Sum = o.Sum
}).ToList(); }).ToList();
stopwatch3.Stop(); stopwatch3.Stop();