-
Notifications
You must be signed in to change notification settings - Fork 11
/
EfUserDal.cs
29 lines (27 loc) · 1.04 KB
/
EfUserDal.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Core.DataAccess.EntityFramework;
using Core.Entities.Concrete;
using DataAccess.Abstract;
using DataAccess.Concrete.EntityFramework.Context;
using Entities.Concrete;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace DataAccess.Concrete.EntityFramework.Repository
{
public class EfUserDal : EfEntityRepositoryBase<User,RentACarContext>, IUserDal
{
public List<OperationClaim> GetClaims(User user)
{
using (var context = new RentACarContext())
{
var result = from operationClaim in context.OperationClaims
join userOperationClaim in context.UserOperationClaims
on operationClaim.Id equals userOperationClaim.OperationClaimId
where userOperationClaim.UserId == user.Id
select new OperationClaim { Id = operationClaim.Id, Name = operationClaim.Name };
return result.ToList();
}
}
}
}