public DalPost GetPostUser(DalUser user) { DalPost UserLoginPost = null; using (Shop shop = new Shop()) { User tmpUser = shop.Users.Where(x => x.Id == user.Id).First(); UserLoginPost = EntityConvertToDTO.PostToDalPost(tmpUser.Post); }; return(UserLoginPost); }
public List <DalCpuFromShop> GetListCpu() { var GetList = new List <DalCpuFromShop>(); using (Shop shop = new Shop()) { var tmplist = shop.ItemFromShops.Where(x => x is CpuFromShop).Select(x => (x as CpuFromShop)).ToList(); GetList = tmplist.Select(x => EntityConvertToDTO.CpuToDalCpuShop(x)).ToList(); }; return(GetList); }
public DalUser GetUser(string login, string password) { DalUser GetUser = null; using (Shop shop = new Shop()) { User tmpuser = shop.Users.Where(x => x.Login.Equals(login) && x.Password.Equals(password)). FirstOrDefault(); if (tmpuser != null) { GetUser = EntityConvertToDTO.UserToDalUser(tmpuser); } }; return(GetUser); }