repository

Can DDD repositories be aware of user context?

孤街浪徒 提交于 2019-11-29 03:31:15
Say you were to develop a system which availability of entities and domain logic is highly dependent on user context. Would it make sense to handle the user context sensitivity within repositories by making individual repository instances user context aware? I'm considering adopting this methodology as a way pulling the reliance on user context away from my Entities but I'm not sure whether there are any pitfalls that I may not be aware of with going this direction. The way I'm planning approaching this first is to add a UserContext parameter to the constructors of repositories that need this

AutoMapper.Map ignore all Null value properties from source object

99封情书 提交于 2019-11-29 03:03:57
I'm trying to map 2 objects of the same type. What I want to do is AutoMapper to igonore all the properties, that have Null value in the source object, and keep the existing value in the destination object. I've tried using this in my "Repository", but it doesn't seem to work. Mapper.CreateMap<TEntity, TEntity>().ForAllMembers(p => p.Condition(c => !c.IsSourceValueNull)); What might be the problem ? Interesting, but your original attempt should be the way to go. Below test is green: using AutoMapper; using NUnit.Framework; namespace Tests.UI { [TestFixture] class AutomapperTests { public class

Unable to load the repository(PyDev for eclipse)

依然范特西╮ 提交于 2019-11-29 02:32:29
问题 I encountered the problem. When i am trying to create new PyDev project, an error occurs: Error: Unable to load the repository http://pydev.org/updates Unknown Host: http://pydev.org/updates/content.xml When i open this link(http://pydev.org/updates) in my browser, it redirects me here - http://pydev.org/updates/content.xml So i understand my Eclipse: he can not find repository because there's nothig to look at this link... Does anybody know how to solve this problem? P.S. I installed PyDev

Git: move existing repository from PC to server, clone from server

梦想的初衷 提交于 2019-11-29 02:25:58
问题 I have an existing Git repository on my local machine. I would like to move that repository to my web server, then git clone on my local machine to check out my repository from the server. I'm planning on then developing on my local machine and pushing updates back to the server. I can ssh from my local machine to the server, but not vice versa. How should I go about this? I think git bundle should be used somehow, though when I tried to git clone my bundle on my server, I got a "warning:

How to set up a git repository where different users can only see certain parts?

丶灬走出姿态 提交于 2019-11-29 02:16:41
问题 How do you set up a git repository where some users can see certain parts of the source code and other users can see all of it? I've seen lots of guides for only giving certain users commit access, but these assume everyone should have read access. I've also heard of gitosis, but I'm not sure it supports this and it hasn't had any commits in over a year so I think it's dead. 回答1: In short: you can't . Git is snapshot based (at conceptual level at least) version control system, not changeset

Why aren't the Android SDK Jars in any Maven Repository?

泪湿孤枕 提交于 2019-11-29 02:06:55
问题 Is there any reason that the Android toolchain and development jars aren't in the Maven CEntral repository? Is it really just that no one has done it? or are there some licensing issues? I mean it's all open source right? (except for the Google APIs). I'm tempted to put it up myself in a non central repo, but I just want to be sure that someone else hasn't done it yet and that I won't be corresponding or playing telephone tag with any lawyers as a result. 回答1: Google now has an official maven

Unit testing Entity Framework with Mock IDbSet

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 02:01:09
I've never really done unit testing before, and I've stumbled and tripped on my first test. The problem is that the _repository.Golfers.Count(); always indicates that the DbSet is empty. My test is simple, I'm just trying to add a new golfer [TestClass] public class GolferUnitTest //: GolferTestBase { public MockGolfEntities _repository; [TestMethod] public void ShouldAddNewGolferToRepository() { _repository = new MockGolfEntities(); _repository.Golfers = new InMemoryDbSet<Golfer>(CreateFakeGolfers()); int count = _repository.Golfers.Count(); _repository.Golfers.Add(_newGolfer); Assert.IsTrue(

Where should I put a unique check in DDD?

三世轮回 提交于 2019-11-29 01:16:21
问题 I'm working on my first DDD project, and I think I understand the basic roles of entities, data access objects, and their relationship. I have a basic validation implementation that stores each validation rule with it's associated entity. This works fine for rules that apply to only the current entity, but falls apart when other data is needed. For example, if I have the restriction that a username must be unique, I would like the IsValid() call to return false when there is an existing user

What is git's “filemode”?

﹥>﹥吖頭↗ 提交于 2019-11-29 01:01:20
For something that exists in EVERY single git repo... on earth... there sure isn't very much info out there regarding filemode . The first 100 responses from google were all over the place, and a question with this' title handn't been asked.. so here goes.. What is filemode ? For me, it's in every repo's ./git/config file, near the top, a lá... [core] filemode = true What is it? What does it mean? Does it bear any relation to bare = false which I also don't really get... I use git like a madman , and know what a million other of git's endless, and IMHO, arbitrarily concocted / half-brained

Linking a single file from another git repository

人走茶凉 提交于 2019-11-29 00:56:41
How do you link a single file from another git repository to your own repository? I don't want the full repository, just a single file. Using git submodule seems like the right route to go, but it wants to grab the whole thing. Considering that the unit of work for git is a repository (or more precisely a repository content ), I don't think you can easily integrate one file. If you don't need its history, you could consider simply copy it in your repo. But if you do need the history, then some git filter-branch (as in " git: How to split off library from project? filter-branch, subtree? ") are