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; }
[BsonElement("date")]
private DateTime DateMongo { get; set; }
public DateTime DateMongo { get; set; }
[BsonIgnore]
public DateOnly Date {
get

View File

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