Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of old code #837

Merged
merged 4 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions OutOfSchool/OutOfSchool.DataAccess/Models/City.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ private void ApplySoftDelete(ModelBuilder builder)
.ApplySoftDelete<ChatMessageWorkshop>()
.ApplySoftDelete<ChatRoomWorkshop>()
.ApplySoftDelete<Child>()
.ApplySoftDelete<City>()
.ApplySoftDelete<CATOTTG>()
.ApplySoftDelete<CompanyInformation>()
.ApplySoftDelete<CompanyInformationItem>()
Expand Down
2 changes: 0 additions & 2 deletions OutOfSchool/OutOfSchool.DataAccess/OutOfSchoolDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public OutOfSchoolDbContext(DbContextOptions<OutOfSchoolDbContext> options)

public DbSet<Rating> Ratings { get; set; }

public DbSet<City> Cities { get; set; }

public DbSet<Favorite> Favorites { get; set; }

public DbSet<DateTimeRange> DateTimeRanges { get; set; }
Expand Down
13 changes: 3 additions & 10 deletions OutOfSchool/OutOfSchool.ElasticsearchData/ESWorkshopProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,10 @@ private QueryContainer CreateQueryFromFilter(WorkshopFilterES filter)

if (filter.Ids.Any())
{
var box = new List<object>();
foreach (var item in filter.Ids)
{
box.Add(item);
}

queryContainer &= new TermsQuery()
{
Field = Infer.Field<WorkshopES>(w => w.Id),
Terms = box,
Terms = filter.Ids.Cast<object>(),
};

return queryContainer;
Expand All @@ -79,7 +73,7 @@ private QueryContainer CreateQueryFromFilter(WorkshopFilterES filter)
{
queryContainer &= new TermsQuery()
{
Field = Infer.Field<WorkshopES>(w => w.Directions.FirstOrDefault().Id),
Field = Infer.Field<WorkshopES>(w => w.DirectionIds),
Terms = filter.DirectionIds.Cast<object>(),
};
}
Expand Down Expand Up @@ -151,11 +145,10 @@ private QueryContainer CreateQueryFromFilter(WorkshopFilterES filter)

if (filter.Statuses.Any())
{
var box = filter.Statuses.Select(x => (object)x);
queryContainer &= new TermsQuery()
{
Field = Infer.Field<WorkshopES>(w => w.Status),
Terms = box,
Terms = filter.Statuses.Cast<object>(),
};
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class WorkshopES

public string Keywords { get; set; }

public List<DirectionES> Directions { get; set; }
public List<long> DirectionIds { get; set; }

[Nested]
public List<DateTimeRangeES> DateTimeRanges { get; set; }
Expand Down
Loading