Found 12 packages
Used for unit testing EF queries based on
A set of data access-related fakes that can be used for unit testing purposes.
Provides the following: * EntityBase - a base entity class to inherit from. Provides the following fields: Created (datetime) LastModified (datetime?) Enabled (bool) * DbContextWithAutomaticTrackingFields - when persisting entities which derive from EntityBase, this will automatically set Created to the current timestamp on a new entity and update LastModified on an updated entity * Extensions to: - AddRange on an IDbSet - AddRange on an ICollection - RemoveRange on an IDbSet - RemoveRange on an ICollection - Clear on IDbSet (delete all in dbset) - AddNew on IDbSet and ICollection - Convenience method so you can, for example, do: var someItem = context.SomeCollection.FirstOrDefault(i => i.Name == "bob") ?? context.Collection.AddNew(e => e.Name = "bob"); which finds the first bob or adds a new one - Transform, which provides a fluent manner to do what you would with Select(), but on a single result
Automatically setting up an EF6 DbContext interface using an in-memory implementation of IDbSet and Moq
This extension to Entity Framework Core adds a Set<TContext, TEntity> method to IDbCOntextFactory<TContext>. This allows you to easily execute multiple queries in parallel without the need to write complex code, or a lot of using blocks or statements. You can stick to all your known methods from IQueryable<TEntity>. As the context is disposed after your query is executed, all results will obviously not be tracked and disconnected from any DbContext.
GZFramework快速开发框架 更多详情请联系作者:GarsonZhang QQ:382237285 2016年5月26日15:56:42: 获取参数返回值从IDatabase调到IDbParms接口 2016年5月26日14:52:58: IDbParms接口增加设置重置参数值方法:SetParmValue 修复空参数未将对象实例化bug 去掉IDBConfig接口,使用静态事件DatabaseFactory.CreateDataBaseEvent替代 去除静态事件(改为外部处理),使底层更健壮
A set of Dapper style IDbConnection extension methods to store .net objects as json in a database.
Allows commands to have services or dependencies provided by the CommandProcessor. For example a database command might look like this public class GetUserCommand : DbCommandBase<Use> { //Constructor only takes the arguments necessary to run the command public GetUserCommand(int userId) { this.UserId = userId; } public int UserId {get;set;} public override User Execute(IDbConnection db) { return db.Query<User>("Select * from User where Id = @UserId", new { UserId}, this.Transaction) .FirstOrDefault(); } } The Command executor will then provide the neccessary DbProviderFactory to the command before execution. (nb: The DbCommandBase is creating the actual connection) Commands can all execute other commands, e.g. this.Execute(new SendNewUserEmailCommand("Johnny", "John@doe.com")); It is then the responsiblity of the Command Executor to provide the necessary email sending service. More info can be found here. http://github.com/markkemper1/Commando
1. Tags: Utility, Sinx, SinxUtility, Sinx.Utility, Tool, bclExtension 2. Version 0.0.1.16: a. Get all files of a dir i. Method System.IO.File.DirectoryEx.GetFiles b. [net451] Convert office(word only this version) FileStream to html file i. Extension of System.IO.FileStream.SaveAsync ii. System.IO.FileStreamEx.SaveAsync 3. Version 0.0.1.26 a. Add System.Net.Http.HttpRequestMessageEx.CreateFromRaw method for create a request from raw from fiddler etc. b. Add System.Text.RegularExpressions.RegexEx.[set] for emil and url validate 4. Version 0.0.1.29 a. Add System.Net.Http.HttpRequestMessageEx.Clone method for clone a httpRequestMessage instance without connection processing limit b. [net451] System.Net.Mail.SmtpClient.Create method for create a client use Tecent QQ email or 163 email 5. Version 0.0.1.30 a. Add System.Reflection.TypeInfoEx.GetAssignedProperties method for get a complex class instance's initialized by user 6. Version 0.0.1.35 a. Add System.Data.IDbConnectionEx, witch makes your data operate easier.
Manage your DbContexts the right way. The persistence or infrastructure layer uses the DbContext (e.g. from a repository). Controlling its scope and transaction lifetime, however, is ideally the reponsibility of the orchestrating layer (e.g. from an application service). This package adds that ability to Entity Framework Core 5.0.0 and up. https://github.com/TheArchitectDev/Architect.EntityFramework.DbContextManagement Release notes: 2.0.1: - Enhancement: Upgraded package versions. 2.0.0: - BREAKING: Now using AmbientContexts 2.0.0. - Semi-breaking: Failure on commit (extremely rare) now throws IOException instead of Exception. - Added static DbContextScope<TDbContext>.HasDbContext, to match the feature set of IDbContextAccessor. - Retries now ensure that the connection is closed before retrying, to avoid the risk of leaking session state. (As with EF's DbContext disposal in general, this relies on the database provider's connection reset.) - Scoped execution now protects against dangerous "failure on commit" retries even on manual commits (rather than just on IExecutionScope's implicit commit). - Worked around an EF bug where the DbContext would obscure the exception caused by a broken model behind an ObjectDisposedException, even though DbContext._disposed=false. - Scoped execution: Fixed a bug where the exception caused by a broken model would be obscured behind a wrongful IncompatibleVersionException. - MockDbContextProvider: Fixed a bug where nested scopes would not work as expected. - MockDbContextProvider: Fixed a bug where soft attempts to roll back a transaction when there was none could cause an unintended TransactionAbortedException. 1.0.1: - Now using AmbientContexts 1.1.1, which fixes extremely rare bugs and improves performance.
A .NET Core, Standard 2.0 generic Repository implementation in which you can leverage OData query syntax and combine OData queries with EF's IDbSets, i.e. combine IQueryable objects from OData and EF as data providers.
Don't spend hours writing code to mock a dozen dependencies, and more hours debugging it. Just write your test code, and let FixtureBase create the dependencies for you. FixtureBase constructs your UnitUnderTest to test your codebase end-to-end, with external dependencies auto-faked and automatically injected in just the right place; even constructor dependencies that are several layers deep. You just write your tests: ``` public class FixtureBaseExample : FixtureBaseWithDbAndHttpFor<AUseCase> { [Fact] public void UUTSendsDataToDb() { var newDatum = new Datum{Id=99, Name="New!" }; UnitUnderTest.InsertDb(newDatum); Db.ShouldHaveInserted("Data",newDatum); } [Fact] public void UUTreturnsDataFromDbQuerySingleColumn() { var dbData = new[] { "row1", "row2", "row3", "row4"}; Db.SetUpForQuerySingleColumn(dbData); UnitUnderTest.FromDbStrings().ShouldEqualByValue(dbData); } [Fact] public async Task UUTGetHttpReturnsDataFromService() { var contentFromService = "IGotThis!"; HttpClient .Setup(m => true) .Returns(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent(contentFromService)}); (await UnitUnderTest.GetHttp()).ShouldBe(contentFromService); HttpClient.Verify(x=>x.Method==HttpMethod.Get); } } ``` The included examples demonstrate FixtureBases for applications which depend on Ado.Net IDbConnections and on HttpClient network connections. - To create your own FixtureBase with your own preferred Fakes, see the examples at <https://github.com/chrisfcarroll/ActivateAnything/blob/master/FixtureBase/FixtureExample.cs.md> - For how it's done, see <https://github.com/chrisfcarroll/ActivateAnything/blob/master/FixtureBase/FixtureBase.cs> Construction is done by - [ActivateAnything](https://www.nuget.org/packages/ActivateAnything) Faking is done by - [TestBase.AdoNet](https://www.nuget.org/packages/TestBase.AdoNet) - [TestBase.HttpClient.Fake](https://www.nuget.org/packages/TestBase.HttpClient.Fake) For more tools focussed on cutting the cost of unit testing, see also: - [TestBase](https://www.nuget.org/packages/TestBase) - [TestBase.AspNetCore.Mvc](https://www.nuget.org/packages/TestBase.AspNetCore.Mvc) - [TestBase-Mvc](https://www.nuget.org/packages/TestBase-Mvc) - [TestBase.AdoNet](https://www.nuget.org/packages/TestBase.AdoNet) - [TestBase.HttpClient.Fake](https://www.nuget.org/packages/TestBase.HttpClient.Fake) - [Serilog.Sinks.ListOfString](https://www.nuget.org/packages/Serilog.Sinks.Listofstring) - [Extensions.Logging.ListOfString](https://www.nuget.org/packages/Extensions.Logging.ListOfString)