문제

I have followed below steps

  1. Created a new C# solution in VS 2012
  2. Added a c# class Library project for creating Model from existing Database
  3. Added a new EDMX file off of an existing database to above project
  4. Built the project succesfully
  5. added new C# Class library project for creating a repository class
  6. Added a reference to Library project created in the step 1
  7. Added a new class "XyzRepository" that has CRUD operations (written in L2E) required for web service methods
  8. Built successfully
  9. Created a new MVC 4 project of type WebAPI template and addded a ApiController
  10. Inside the Api Controller Created a HttpPost method "UpdateStatus" with return type HttpResponseMessage
  11. Instantiated XyzRepository and invoked _respository.UpdateStatus a bollean return type method
  12. Constructed response using Content = new StringContent("");
  13. Returned response
  14. Consumed WebAPI using HttpClient from another MVC 4 project of type Internet Application template.
  15. Ran the MVC 4 page to see the result and everything works fine.

Now the question

I have seen tonnes of discussions in several forums where Web API is integrated with repository patterns that interacts with POCO classes with code first approach. This approach uses IoC, DI and DatabaseCreation when model changes and so on.

Since i have a existing database i used Database First approach. But I am not entirely sure if my design has any flaws drawbacks in terms of concurrency, performance etc. Since all examples used code first approach that makes me nervous.

I wanted to hear opinions from experts so I don't get surprised later in the cycle.

도움이 되었습니까?

해결책

We are using the same pattern for a large scale web application and there are no issues with concurrency. We have 40,000 people using the system daily with the Application hosted on Windows Azure cloud platform

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top