http://social.technet.microsoft.com/Forums/ru-RU/100106c7-de22-4ea7-ac86-06ff6bf438b5/-?forum=ws2008r2ru
Пуск - администрирование - Локальная политика безопасности
namespace ProductStore.Models { public class ProductDTO { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } } }
private IQueryable<ProductDTO> MapProducts() { return from p in db.Products select new ProductDTO() { Id = p.Id, Name = p.Name, Price = p.Price }; } public IEnumerable<ProductDTO> GetProducts() { return MapProducts().AsEnumerable(); }
Adding a controller in a Web API project works very well - only if your models and EF data context are in the same assembly as the project itself - i.e., located in the project's Models folder.
I created all the POCOs and EF data context in a separate library project, created the library, and referenced it from the Web API project. Unfortunately, the dialogs can only see models and data context whose .cs files reside in the project.
I've looked at similar questions and somehow, other people's add controller dialogs list their models and data contexts from external (referenced) libraries (then they have a different problem, which my problem isn't getting to (yet)).
Is there such a setting (in the IDE or web.config) that I need to specify so that these add controller dialogs will see my library's classes?
| |||
add comment |
So far, I've come up with a "dirty" workaround, which I'm not very satisfied, though it works:
|