Unity is a Dependency Injection container developed by Microsoft.
1
vote
0answers
64 views
Simple Unity Integration
I've been working with web services recently, and I keep copying the same stuff to set up Unity for dependency injection, so I thought I'd extract the common stuff into a library. Here's the main ...
7
votes
1answer
160 views
Event system in Unity RPG game
I'm making event system for my RPG game, and I want to know what I can do better, because I think that there are a lot things that can be better. Note that this code is still not completed but it ...
23
votes
4answers
3k views
Snake Game in C#
Recently, I have been trying to learn SOLID principles. I learn the best through criticism.
I made this snake game in Unity with C#, where I put my current understanding of SOLID principles to test. ...
2
votes
0answers
29 views
Mesh Modifier System in the Unity Game Engine using C#
The system is meant to replicate the deformers and modifiers commonly used in 3D modeling programs like 3DS Max, Maya, Blender and Cinema 4D. I made a post on Reddit, explaining the features and ...
2
votes
0answers
281 views
Caching using MS Unity Interception
I wanted to cache methods using unity interception and not have the parameters passed in stay alive for the sake of caching. If the objects would have gone out of scope without caching then the cache ...
1
vote
1answer
169 views
Unit test Web API controller that uses a static helper class which uses app config setting
I have a situation where I have a static class that reads my application configuration file for some configuration value. When unit testing Web API controllers that make use of this static class I am ...
2
votes
2answers
2k views
Repository Pattern with Dapper + Unity
I just finished the Pluralsight courses about Inversion of Control and Mirco-ORMs, and I am struggling with the implementation aspect of some of the concepts.
This is my (simplified) repository ...
1
vote
0answers
405 views
Identity repository pattern with UnitOfWork, GenericRepository and Unity
I created an application from 3 layers, DAL, BLL, and Representation layer in ASP.NET Web API. In DAL i have 4 Classes:
- DatabaseContext.cs, UnitOfWork.cs, GenericRepository and UserInfo. In BLL i ...
2
votes
1answer
886 views
Repository Pattern universal application
When I started learning Repository Pattern with Unity few days ago I was under impression that the main benefit of this pattern is the separation of data layer from the business layer.
In other words,...
3
votes
1answer
224 views
Unity Repository Best Practices
I am now developing a product, which will use Unity & Repositories when it comes to data management. I will demonstrate on a simple example. What we want to do, ...
1
vote
0answers
166 views
Unity post/get/check www requests with success callback and error callbacks
This is a class I built to handle post/get requests to URL's, but also check for connection and provide different callbacks depending on success or failure. It is intended to work without being ...
8
votes
1answer
8k views
Unit testing with dependency injection and MOQ
I'm just learning how dependency injection and mocking work, but I'd like some feedback on how I'm setting up a couple of tests. I can get them to pass, but I'm not sure this is all I need.
This is ...
3
votes
3answers
1k views
Unity Lazy Resolve Implementation
I have been using Microsoft.Unity as my container and have decided that the approach for a lazy implementation causes too much rework. Each time you decide to swap ...
7
votes
1answer
10k views
EF Generic Repository + Unit of Work pattern with support for Async
I'm working on a generic repository using EF 6 code first and trying to following the Unit of Work pattern. Unity is being used to inject my repositories, and I'm trying to get everything supporting ...
3
votes
0answers
3k views
Unity Owin per request lifetime middleware
Having changed my website over to owin, I can no longer use Unity's PerRequestLifetimeManager. So I'm writing some middleware for owin in the style of Autofac's ...
5
votes
1answer
671 views
Unity and an IoC for Settings
After a somewhat lengthily discussion in the chat room, I have set up an IoC container with Unity to store my settings in.
This is my static IoC class:
...