repository

Should a Repository return IEnumerable<T> , IQueryable<T> or List<T>?

随声附和 提交于 2019-11-29 16:56:24
问题 I'd like to make my application as flexible as possible, but not dig myself into a hole by making my Interface too specific. What is the best object type for a repository? IEnumerable, IQueryable, or List? The technologies I'm considering using are Azure App Fabric Caching Entity Framework 4.1 Possibly Windows Server AppFabric 回答1: I would say build your DAL using IQueryable, and pass it around, make sure your object contects lifetime is the request. This way you will get benefit of delayed

changing the git structure

為{幸葍}努か 提交于 2019-11-29 16:55:19
问题 I want to somehow change the git directory structure. Currently the architecture is like VL(repo) .git (hidden) code files ...... ..... I want it like html(repo) .git VL code files ...... ...... I had a solution to archive the current repo and then create the new repo with above structure. But the bad thing about this approach is that it removes all previous history. is there any better solution? 回答1: Changing the name of the root folder from VL to html shall be no problem since git only

How can I incorporate this Castle Windsor DI code into my Controller and Repository code?

谁都会走 提交于 2019-11-29 16:29:29
Note : I can't bountify this question yet (it's too new), but I will reward a good answer with 50 points, and a great answer with 100 (when possible). I need to incorporate DI into my Web API project. I currently have the expected Model and Controller folders/classes, along with corresponding Repository classes. That seemed to work well for awhile, but now I need to use DI with the Controllers so that I can pass an Interface type to the Controllers' constructor. I'm struggling with just how to implement this; that is, how to incorporate the DI "extravaganza" into my existing Model/Controller

Configuring multiple upload repositories in Gradle build

会有一股神秘感。 提交于 2019-11-29 15:40:30
问题 I want to upload my artifacts to a remote Nexus repo. Therefore I have configured a snaphot and a release repo in Nexus. Deployment to both works. Now I want to configure my build so I can decide in which repo I want to deploy: gradle uploadArchives should deploy to my snapshots repo gradle release uploadArchives should deploy to my release repo This was my try: apply plugin: 'war' apply plugin: 'maven' group = 'testgroup' version = '2.0.0' def release = false repositories { mavenCentral()

Entity framework 6 providing repositories and UoW out of the box

匆匆过客 提交于 2019-11-29 15:26:51
问题 But how do you use it? I have a Code First project set up, and trying out some stuff with this new EF6. Reading all kinds of posts/blogs from at least 2 years old about EF4/5. But nothing whatsoever about EF6. Let's say I have these entities: public DbSet<Person> Persons { get; set; } public DbSet<Order> Orders { get; set; } public DbSet<Invoice> Invoices { get; set; } Do I still need to create repositories for each entity? Or would a class suffice with some methods to do some custom

Git pull - deleted files

China☆狼群 提交于 2019-11-29 13:56:55
I have a development server and a couple of production ones. I do commits from the dev to a remote repository and have git push production setup, that issues a pull from the production servers. I needed to remove a couple of directories with static files from being tracked so I did this Remove an Existing File from a Git Repo (summary: did git rm --cached myfolders , and after that added to .gitignore the folders) I have not yet committed the changes. The files show as deleted when doing git status # deleted: file1.jpg # deleted: file2.jpg # deleted: file3.jpg # deleted: file4.jpg # deleted:

BestPractices: Is it acceptable to use more than one repository in a MVC-Controller?

爱⌒轻易说出口 提交于 2019-11-29 13:23:23
问题 I have a many-to-many assocition between an Employee and a Team. Foreach entity I have a repository. Now I use ASP.NET MVC and I created a EmployeeController. I also created a View to edit an Employee. For this view I need a DropDownList with all Teams. The problem is that my EmployeeController only has got EmployeeRepository. So how can I get all Teams? My solution now is to use two repositories. But is this a good solution? Could I instead create TeamController and write a method returning

NoSuchBeanDefinitionException: No qualifying bean of type [Repository] found for dependency: expected at least 1 bean which qualifies as autowire

倾然丶 夕夏残阳落幕 提交于 2019-11-29 12:52:44
I found similar issues explained many web portals. But I guess this is unique situation. I am getting an error in spring mvc app. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testController' defined in file [C:\Program Files (x86)\sts-bundle\pivotal-tc-server-developer-3.1.2.RELEASE\base-instance\wtpwebapps\ExpT1\WEB-INF\classes\com\expt\controller\TestController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.expt.repositories.CategoryRepository]: No qualifying bean of type [com.expt

How do I fix missing git remote details?

放肆的年华 提交于 2019-11-29 12:45:09
问题 Some repository clones I have allow me to do this: % git pull % git push But other repositories require me to type: % git pull origin master % git push origin master I think I am missing something in the latter case - does anyone know what is (not) going on here? I am using the latest git version, just obviously not using it well. 回答1: If you cd into your repository directory and then open up your .git/config file in an editor. Append this to the end of the file: [branch "master"] remote =

What type is repository pattern in?

心已入冬 提交于 2019-11-29 12:45:05
问题 In general, I know that there are 3 big types of design pattern Creational Pattern (Factory, Singleton, etc) Structural Pattern (Composite, Adapter, Proxy, etc) Behavioral Pattern (Specification, Command, etc) But I dont know which type I can put the Repository pattern in. Is Repository pattern in one of three above type? Or is it kind of in the middle of (2) and (3) pattern? 回答1: Repository can be viewed as a special kind of Façade (structural) but also as a special kind of Factory