public List <GetColor> GetColor() { List <GetColor> list = new List <GetColor>(); using (_ctx = new GuildCarsEntities()) { var colors = _ctx.GetColor(); foreach (var color in colors) { GetColor c = new GetColor(); c.ColorId = color.ColorId; c.ColorName = color.ColorName; list.Add(c); } } return(list); }