repository

C# Service Layer Design Pattern

℡╲_俬逩灬. 提交于 2019-12-31 08:51:52
问题 We are looking into creating a new project and are wanting to explore using the Repository and Service layer patterns, the aim to is create loosely coupled code which is fully testable using mock repositories. Please see below the basic architecture idea. We will be using interfaces to describe the repositories and inject these into the service layers to remove any dependencies. Then using autofac we will wire up the services at runtime. public interface IOrderRepository { IQueryable<Order>

C# Service Layer Design Pattern

╄→尐↘猪︶ㄣ 提交于 2019-12-31 08:51:46
问题 We are looking into creating a new project and are wanting to explore using the Repository and Service layer patterns, the aim to is create loosely coupled code which is fully testable using mock repositories. Please see below the basic architecture idea. We will be using interfaces to describe the repositories and inject these into the service layers to remove any dependencies. Then using autofac we will wire up the services at runtime. public interface IOrderRepository { IQueryable<Order>

Mercurial push, abort: authorization failed

给你一囗甜甜゛ 提交于 2019-12-31 08:43:43
问题 I'm having problems with pushing to mercurial repository: $ hg push pushing to https://user:***@hg.domain.com/X_repo searching for changes abort: authorization failed The same URL (with the same credentials) is accessible through the web browser. Also, I tried it without embedding usr+pass into the URL. HTTPS is correctly configured, I tried both Basic and Digest auth -- without a luck. Pulling (through HTTP) works fine. I'm using hgwebdir to serve my repo. What else should I check? I found

GitHub - How to revert changes to previous state

我的梦境 提交于 2019-12-31 08:05:43
问题 I am using GitHub as my remote repository. I have already pushed 5 commits to the server and want to revert back to the state before the those commits. If the commit hash is 3425661dba2aadccdbab , how do I revert the entire local/remote back to that commit? I tried $ reset --hard 3425661dba2aadccdbab but that only resetted my working head to that branch and requires me to do a git pull again. I tried checkout, but this caused me to land in a "detached head" branch. 回答1: You basically have two

Create a generic repository DropDown with SelectListItem in MVC

╄→尐↘猪︶ㄣ 提交于 2019-12-31 06:58:27
问题 Having returned to this problem after a few months I've added my current best answer below. In the original question I was still looking for a simple way to achieve a generic DropDown but the title was more closely tied to the specific error I was then facing. I've amended the title to reflect the answer more closely. Hopefully this might help someone. Original Question: Generic Editor Template for DropDownListFor throws Cannot convert type error I'm trying to create a generic template for a

Repository generic method GetById using eager loading

柔情痞子 提交于 2019-12-31 03:47:06
问题 I am using Entity Framework and would like to create generic GetById method in Repository class with eager loading: Here is my method which uses lazy-loading: public virtual TEntity GetById(object id) { return DbSet.Find(id); } I know method Find does not support eager loading, but how it is possible to modify this method to use eager loading, so that I use this method as follows(for an example): _unitOfWork.MyRepository.GetById(includeProperties: "Users"); 回答1: One possible way is to use

@Autowire failing with @Repository

陌路散爱 提交于 2019-12-31 02:18:07
问题 I am not being able to make @Autowire annotation work with a @Repository annotated class. I have an interface: public interface AccountRepository { public Account findByUsername(String username); public Account findById(long id); public Account save(Account account); } And the class implementing the interface annotated with @Repository : @Repository public class AccountRepositoryImpl implements AccountRepository { public Account findByUsername(String username){ //Implementing code } public

jqGrid & ASP.NET 4 MVC: How to make search implementation on a DBContext repository and 'calculated' properties?

梦想的初衷 提交于 2019-12-30 14:48:23
问题 I'm trying to implement jqgrid search on MVC, following the interesting answer by @Oleg, regarding the question: ASP.NET MVC 2.0 Implementation of searching in jqgrid. Actually I have a data repository based on EF & DBContext. Moreover, I have an entity with 'calculated' fields, I mean properties in DbSets that are calculated on the base of other fields. I have two main problems, implementing the solution described in the first answer of the above link: 1st problem) The solution is based on

How to synchronize a GIT repository with SVN?

烈酒焚心 提交于 2019-12-30 11:35:30
问题 I am planning to make a fork of an open-source project, but I want to switch to GIT. The project is using SVN, but there is no TRAC available, so I can't just download changesets without having SVN on my PC (not to mention svn diff doesn't allow binary patches). Is there a way to synchronize my GIT master repository with SVN's HEAD/trunk without keeping another project on my HDD? 回答1: You can synchronize SVN with Git using git-svn(1). If you have existing Git repository, and want to bind with

How to create a logo for mvnrepository artifact

て烟熏妆下的殇ゞ 提交于 2019-12-30 08:24:33
问题 There are a logo on artifcats in mvnrepository. Can't find the way to do that. Example: http://mvnrepository.com/artifact/org.apache.nifi/nifi-api This is my artifact and the icon is {h}: https://mvnrepository.com/artifact/ru.sadv1r.vk/vk-parser How to change it? 回答1: You should be able to put a logo tag directly under the project and organization tag with the URL of your logo in your pom.xml file. For more info you can check the Maven doc here: http://maven.apache.org/archives/maven-1.x