Skip to content

Commit

Permalink
Update Basics.md
Browse files Browse the repository at this point in the history
  • Loading branch information
enisn authored Oct 25, 2022
1 parent 6d5b4fc commit 5e55bbf
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docs/en/Basics.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Basics
- Let say you have a Model like that:

Entity:
```csharp
public class Blog
{
Expand All @@ -12,18 +12,17 @@ public class Blog
}
```

- Let's create a filtering DTO like that:

Create a filter object for Blog Entity:
```csharp
public class BlogFilterDto : FilterBase<Blog>
public class BlogFilterDto : FilterBase
{
public int CategoryId { get; set; }
public int Priority { get; set; }
public bool? IsPublished { get; set; }
}
```

- Let's create a sample Controller and get the DTO from querystring
- Create a sample Controller and get the DTO from querystring:

```csharp
public class BlogsController : ControllerBase
Expand All @@ -48,4 +47,4 @@ public class BlogsController : ControllerBase
* `/Blogs?IsPublished=True&Priority=1`
* `/Blogs?IsPublished=True&Priority=5&CategoryId=1`

***
***

0 comments on commit 5e55bbf

Please sign in to comment.