repository

Explain the mysterious world of IoC and automatic Dispose

有些话、适合烂在心里 提交于 2019-12-04 19:18:09
I'm ASP.NET MVC newbye and I'm learning and experimenting Enterprise design patterns: very interesting and helpful things indeed! But I keep missing something about the concept of disposing resources. To be more specific want to focus on the mechanism of controllerFactory which injects in the controller constructor an implementation of IFuncyRepository or IFuncyService or anyother kind of "resource" to be used in the controller (In my case I'm using StructureMap as IoC). My question is WHERE / IF / HOW these injected resources get Disposed. The book I'm following as guideline is ASP.NET Design

Moving a git repository down a hierarchy level

≯℡__Kan透↙ 提交于 2019-12-04 19:18:04
问题 I was searching for hours now but couldn't find a satisfying answere even though it appears to be simple noobish question. What I basically want to accomplish is to move my .git directory which currently resides besides my project folder down into the project folder. Optimally this shouldn't alter the repository history at all although I don't know whether this is actually possible. The reason I want to do this a somewhat IDE/project-type related problem I can solve this way. I appreciate any

MVC architecture - patterns

自闭症网瘾萝莉.ら 提交于 2019-12-04 18:17:54
I need some help with MVC architecture. I use the following architecture for an object named User. UserRepository -> IUserRepository -> UserService -> IUserService -> UserController The User object comes from my database and I'm using EntityFramework. I have a function that returns a list of users Return_All_Users(). One of the fields that gets returned is "UserType". This comes out as a number, but when I show the list in my Index.aspx page, I would like it to show as a string. The number for "UserType" needs to look into a Dictionary to find the string that goes along with the number like

How do you centralize the Entity Framework data context in a web application?

五迷三道 提交于 2019-12-04 17:31:17
In our application we use the repository pattern to retrieve and persist data from our data storage medium. The medium we opted to use is Entity Framework 4. This seems to be a very clean way to do things and has worked great 99% of the time. Now we are encountering an issue. We have two repositories, like this: public class UserRepository : IUserRepository { Entities dataContext = new Entities(); public User GetUser(string username) { return dataContext.Users.SingleOrDefault(x => x.Username == username); } // ... more CRUD-style methods that are not relevant to this question. public void

How to skip the release or specific modules in the maven repo

孤街浪徒 提交于 2019-12-04 16:38:29
问题 Heyho, I have a maven project with this scructure: parent: List item API module module2 ... module5 test distribution/assembly So first i run the parent module, then I run the module which builds the api, then the modules which depend on the api, then a test module which contains tools to test and at the end I run a assembly/distribution where I package some modules in a archive. Because of some problems I can not really change the way and it works so far perfect. With the jenkins I release

Creating a local SVN branch

对着背影说爱祢 提交于 2019-12-04 16:26:48
问题 I am working on an SVN repository and do not want to create a new SVN branch. Instead of that, I want to create a branch local to my machine, something which could be done easily with Git. But I am currently using SVN and need to branch out from an already-modified SVN version. In essence, I want following: svn_repo_version = 2259 working_copy = modified 2259 new_local_svn_branch = based on modified 2259 What is the best way to go about it? 回答1: Subversion is a centralized version control

Combine a base project that is growing in child projects in git repository except git submodule or subtree merge methods

你离开我真会死。 提交于 2019-12-04 15:06:29
There are some child projects: "Project 1", "project 2" and so on in the future. Also, There is a project that named: "Base Project" and it's foundation of other projects. "Base Project" is a content management system (CMS). All projects have their own git repositories. "Project 1" , "project 2" and others uses "Base Project" to develop and grow. There are some methods in git like submodule or subtreemerge. but don't seem to fit here. "Base Project" not should be clone into a sub directory. It's in root directory. It's growing in "project 1" or "project 2"... When I work in child projects, I

Maven. Repository authentication

点点圈 提交于 2019-12-04 14:55:25
I tried setup deploy to local repository: -- settings.xml -- <server> <id>myrepo</id> <username>deployer</username> <password>123456</password> </server> -- pom.xml --- <repositories> <repository> <id>myrepo</id> <url>http://myserver.com/artifactory/libs-release-local</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>false</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> when I execute "mvn deploy" I got error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.4:

How to get first EntityKey Name for an Entity in EF4

僤鯓⒐⒋嵵緔 提交于 2019-12-04 14:26:08
问题 How can I get the 1st EntityKey name for an Entity for Entity Framework 4 because I'm building a repository system and I wanted to get an item by Id (which is the primary key oin EF is the 1st entitykey for the entity) I'm using this code public virtual TEntity GetById(string keyName, Guid entityId) { var entityKey = new EntityKey(this.QualifiedEntitySetName, keyName, entityId); object entity; return this.Context.TryGetObjectByKey(entityKey, out entity) ? entity as TEntity : null; } I want to

Xcode duplicates my repository and renames its location to lowercase

孤者浪人 提交于 2019-12-04 13:46:17
I have a Git repository where my project is linked to. It is located somewhere like /Users/a/Documents/Xcode Projects/MyProject . I use Xcode's UI to commit changes and it worked perfectly for a couple of times. But now, out of a sudden, I get this error when trying to commit new changes: The working copy myproject could not be reached. Please verify that the working copy is reachable and try again. As you can see, the message shows my project's name in lowercase and when I check the Repositories in XCode (File - Source Control - Repositories...). I see there are two, apparently identical,