Skip to content

Instantly share code, notes, and snippets.

View dhavalmpanchal's full-sized avatar
🎯
Focusing

Dhaval Panchal dhavalmpanchal

🎯
Focusing
View GitHub Profile
@dhavalmpanchal
dhavalmpanchal / IRepository.cs
Created September 20, 2020 12:13
IRepository and UnitOfWork
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace Taste.DataAccess.Data.Repository.IRepository
{
public interface IRepository<T> where T : class
{
endpoints.MapGet("/products", (context) =>
{
var products = app.ApplicationServices.GetService<JsonFileProductService>().GetProducts();
var json = JsonSerializer.Serialize<IEnumerable<Product>>(products);
return context.Response.WriteAsync(json);
});