public List <MarketConfigDto> GetMarketsConfig(UserPass user) { if (!_security.Check(user)) { throw new AuthenticationException(); } var idUser = _security.GetUserId(user); var list = new List <MarketConfigDto>(); using (var context = new BeerControlEntities()) { var dbMarket = context.Market.Where(m => m.idUser == idUser); foreach (Market mr in dbMarket) { list.Add(DtoFactory.CreateEx(mr)); } } return(list); }