Skip to content

Commit 7509b4a

Browse files
🔨 Implement contains and equal endpoint
1 parent baf7a24 commit 7509b4a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sample/EntityFrameworkCore.DataEncryption.Sample/Controllers/AuthorController.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ public AuthorController(SampleDbContext context)
1515
_context = context;
1616
}
1717

18-
[HttpGet(Name = "Filter")]
19-
public Task<IActionResult> FilterAsync([FromQuery]string phone)
18+
[HttpGet("equal",Name = "Equal")]
19+
public Task<IActionResult> EqualAsync([FromQuery]string phone)
2020
{
2121
return Task.FromResult<IActionResult>(Ok(_context.Authors.Where(a=>a.Phone == phone).ToList()));
2222
}
23+
[HttpGet("contains",Name = "Contains")]
24+
public Task<IActionResult> ContainsAsync([FromQuery]string phone)
25+
{
26+
return Task.FromResult<IActionResult>(Ok(_context.Authors.Where(a=>a.Phone.Contains(phone)).ToList()));
27+
}
2328

2429
[HttpPost(Name = "Insert")]
2530
public async Task<IActionResult> InsertAsync([FromBody]Author author)

0 commit comments

Comments
 (0)