public MainWindow() { var usersManagerService = StructureMapDefnation.Container.GetInstance<IUser>(); var qUser = usersManagerService.Find(x => x.Username == "k" && x.Password == "k"); InitializeComponent(); }
public class EfUserService : EfGenericService<User>, IUser { public EfUserService(IUnitOfWork uow) : base(uow) { } }
public class EfGenericService<T> : IGenericService<T> where T : class { protected IUnitOfWork Uow; protected IDbSet<T> Entites; public EfGenericService(IUnitOfWork uow) { Uow = uow; Entites = Uow.Set<T>(); } public T Find(Func<T, bool> predicate) { return Entites.Where(predicate).FirstOrDefault(); } }
public T Find(Func<T, bool> predicate) { return Entites.Where(predicate).FirstOrDefault(); }
check for case sensitivity
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)