unit-of-work

Undefined index error upon $em->clear() in Symfony2

风流意气都作罢 提交于 2019-12-03 15:13:20
问题 I have written a Symfony command to import some data from an API. It works but the problem is my PHP memory usage increases when I insert a big JSON in my database. And my unitOfWork increases by '2' to after each activty import. I have already unset all my used objects, and I have read the documentation of Symfony2 when you want to do massive batch: http://www.doctrine-project.org/blog/doctrine2-batch-processing.html But when I use $em->clear() my entity manager gives this error: Notice:

Calling commands from within another command Handle() method

喜欢而已 提交于 2019-12-03 13:57:00
问题 Hi I am using the Simple Injector DI library and have been following some really interesting material about an architectural model designed around the command pattern: Meanwhile... on the command side of my architecture Meanwhile... on the query side of my architecture The container will manage the lifetime of the UnitOfWork , and I am using commands to perform specific functions to the database. My question is if I have a command, for example an AddNewCustomerCommand , which in turn performs

ASP.NET MVC WebApi: No parameterless constructor defined for this object

旧街凉风 提交于 2019-12-03 12:42:40
I have an ASP.NET MVC 4 Application that I want to implement Unit of Work Pattern. In my Web Project I have: IocConfig.cs using System.Web.Http; using NinjectMVC.Data; using NinjectMVC.Data.Contracts; using Ninject; namespace NinjectMVC { public class IocConfig { public static void RegisterIoc(HttpConfiguration config) { var kernel = new StandardKernel(); // Ninject IoC // These registrations are "per instance request". // See http://blog.bobcravens.com/2010/03/ninject-life-cycle-management-or-scoping/ kernel.Bind<RepositoryFactories>().To<RepositoryFactories>() .InSingletonScope(); kernel

Correct disposing using Repository and Unit Work patterns with Entity Framework?

a 夏天 提交于 2019-12-03 12:25:49
问题 Cheers!I have some doubts about using Unit of Work with Repository. Specially a role of child context from Entity Framework. I have searched a lot of information about this theme, but all that I found just different types of using patterns, I'm confused and I can't understand main think. 1.Where I should realize disposing and saving? -Is it correctly realize Disposable in Inheritance class of DbContext? After that realize in Repository and Unit of Work or just in Uni fo Work? -Where put

using UnitOfWork and Repository Pattern with Entity Framework

坚强是说给别人听的谎言 提交于 2019-12-03 11:17:29
问题 I'm gonna to use repository and UnitOfwork in my data access layer to do this take a look at one contact aggregateroot public interface IAggregateRoot { } this is my Generic repository interface : public interface IRepository<T> { IEnumerable<T> GetAll(); T FindBy(params Object[] keyValues); void Add(T entity); void Update(T entity); void Delete(T entity); } and my POCO Contact class in Model public class Contact :IAggregateRoot { public Guid Id { get; set; } public string Name { get; set; }

Should I be using a Generic Repository with Entity Framework 5?

巧了我就是萌 提交于 2019-12-03 10:54:22
I'm currently using Entity Framework with a Generic Repository and Unit Of Work Pattern. My Model is similar to the one described in this article I've used Generic Repositories in the past and really enjoyed the global functionality it can provide. However, it seems I'm running into more problems every single day when it comes to using it with Entity Framework. These problems seem to arise even more when it comes to handling Parent/Children/Junction relationships. Using a Generic Repository with EF is starting to leave a bad taste in my mouth, and I'm beginning to think that using a Generic

Where should I create the Unit of Work instance in an ASP.Net MVC 3 application?

允我心安 提交于 2019-12-03 10:12:15
问题 I have read as many of the posts on Stackoverflow as I can find with regards the use of a Unit of Work pattern within an ASP.Net MVC 3 application which includes a Business Layer. However, I still have a couple of questions with regards this topic and would greatly appreciate any feedback people can give me. I am developing an ASP.Net MVC 3 Web application which uses EF 4.1. I will be using both the Repository and Unit of Work Patterns with this project similar to how they are used in this

Service Layer/Repository Pattern

烈酒焚心 提交于 2019-12-03 08:46:30
I am building an MVC app using the Service Layer/Repository/Unit of Work pattern with EF4. I am a bit confused on the logic. I know the point is to decouple the system, but I am a little confused. So the MVC Controllers call on the Services to fill the View Models. So is it safe to say the MVC App is coupled to the Service Layer? Then the Service Layer calls on the Repository to get and persist objects. Is then safe to say the Service Layer is dependent to the Repository? The Repository the utilizes EF4 to get and persist data to SQL server, so I would assume the Repository depends on EF4

Unit of Work Design Pattern

主宰稳场 提交于 2019-12-03 07:38:46
Does anyone have any good links about a practical example of Unit of Work pattern with LINQ to SQL The only resource that I know off is the code for Suteki Shop , an ASP.Net MVC application which uses LINQ To SQL. One change they carried out recently was to implement the Unit of work pattern in all the controllers. Rick Strahl has some good stuff on it . Ritesh Rao implements it over nhibernate, entity framework and linq to sql in his ncommon framework: http://www.codeinsanity.com/2008/09/unit-of-work-pattern.html http://code.google.com/p/ncommon/ 来源: https://stackoverflow.com/questions/974983

Entity Framework with multiple edmx

我与影子孤独终老i 提交于 2019-12-03 06:50:51
Let's say I have in my database multiple db schema for example : HumanRessources and Inventory. In each of those schema contains multiple tables. Do you usually split your DB into multiple edmx or usually just put everything in one single edmx? I was thinking about creating a edmx for each schema, but wondering how this will impact a unitorwork pattern. Reading through some articles, the ObjectContext will be the unitofwork. By defining 2 edmx, I will end up with 2 ObjectContext : HumanRessourceContext and InventoryContext, meaning each will will be a unitofwork. What if I want all