public CreateCompoundEntityViewModel Create() { var anotherEntities = _anotherEntitiesQuery.Execute(); var simpleEntities = _simpleEntitiesQuery.Execute(); var viewModel = new CreateCompoundEntityViewModel(); viewModel.AnotherEntities = anotherEntities .Select(p => new SelectListItem() { Value = p.Id.ToString(), Text = p.Name }) .ToList(); viewModel.SimpleEntities = simpleEntities .Select(p => new SelectListItem() { Value = p.Id.ToString(), Text = p.Name }) .ToList(); viewModel.CompoundEntity = new CreateCompoundEntityModel(); return(viewModel); }
public ViewResult Index() { var anotherEntities = _query.Execute(); return(View(anotherEntities)); }
public IEnumerable <AnotherEntitiyModel> Get() { return(_query.Execute()); }