Commit Graph

149 Commits

Author SHA1 Message Date
Shannon Deminick
b73efd16dc Fixes ServiceContext to ensure the repo's are lazy instantiated because their ctor's rely on the
RepositoryResolver.Current being initialized which normally doesn't occur until after the ServiceContext
is constructed. Adds instance level caching for the GetRecursiveValue method in case this is called more than
one time for a property in one view. Reverts PetaPocoUnitOfWork to allow more than one call to Commit().. this
isn't 'best practices' per se but it is more for performance reasons because otherwise we'd have to create a new
repo object + uow for any bulk saving operations... The end result is the same, bulk operations in the Services
cannot be processed in one transaction. Fixing up the ContentServiceTests by ensuring that the shared and always open sqlce
connection with the legacy SqlCeContextGuardian is closed on TearDown.
2012-12-15 10:33:29 +05:00
Shannon Deminick
ad7aa66b0b Changes PetaPocoUnitOfWorkFactory to accept an IDatabaseFactory as ctor. Changes PetaPocoUnitOfWork to not dispose of the Database since
it will be shared with the current thread in order to support nested transactions and changes how the Transaction object is created
and used and then disposed of. Changes PetaPocoUnitOfWorkFactory to ensure that the UOW is
created with the shared Database instance. Fixes a method in UserService to ensure that the UOW is disposed since it wasn't using a repository.
2012-12-15 08:41:46 +05:00
Morten Christensen
f5bfb90b64 Manually merging a few changes to the ContentService, ContentFactory, ContentRepository and ContentExtensions to avoid a merge hell when pushing latest to the legacy refactor branch.
Current checkin has a few new failing tests due to recent changes, but a few should be resolved by adding a DataTypesResolver setup in the ContentServiceTests fixture.
2012-12-14 15:19:54 -01:00
Shannon Deminick
a37abbe622 Merge 2012-12-14 08:06:45 +05:00
Shannon Deminick
a9cb337a96 Changes ApplicationContext to expect arguments of DatabaseContext and ServiceContext for it to be
constructed. Changes DatabaseContext to not be a singleton. Changes ServiceContext not to be a singleton.
Removed ServicesFactory. Updated unit tests to support new changes.
2012-12-14 08:06:32 +05:00
Morten Christensen
029824c8bc Reverting internal methods to public methods in RepositoryFactory 2012-12-12 17:37:13 -01:00
Morten Christensen
877c38b8bc Moving RepositoryFactory to constructor to avoid hard dependency on the RepositoryResolver in the services. 2012-12-12 10:47:14 -01:00
Morten Christensen
e71a5fd5eb Fixing an issue with the MediaService.
Making the two UOW Providers public, so they can be used for newing up services.
Adding a few constructor options to the PP UOW Provider to avoid config lookup.
2012-12-12 09:00:00 -01:00
Shannon Deminick
1e41db6d69 Removed any manual instantiation of PetaPocoUnitOfWork as this should generally always
be done by the PetaPocoUnitOfWorkProvider to ensure that for a UOW it always uses a new database
instance, not a shared one.
2012-12-12 06:08:03 +05:00
Shannon Deminick
a3938edde2 Changed the PetaPocoUnitOfWorkProvider to ensure that a new Database object is used for each new
unit of work (transaction). When the UOW is diposed, the database instance will also be disposed.
2012-12-12 05:57:52 +05:00
Shannon Deminick
1132547c24 Changed required Database references to UmbracoDatabase 2012-12-12 05:48:18 +05:00
Shannon Deminick
a0e4492a35 New implementation of IDatabaseFactory, allows setting the DatabaseContext.Current at runtime
with a custom IDatabaseFactory (mostly for testing).
Changes AuditTrail to internal so the public way is just with the 'Audit' class.
Fixed ThreadSafetyServiceTests which was failing with the new AuditTrail stuff because of the
Database instances, this is not solved with the new PerThreadDatabaseFactory for the unit test.
Created new 'UmbracoDatabase' object which inherits from the PetaPoco one so that we can future proof
the implementation as we might want some custom logic on there. Now the IDatabaseFactory returns
an UmbracoDatabase instead of just Database.
2012-12-12 03:47:04 +05:00
Shannon Deminick
6ac2db9497 removed database factory, changed audit trail stuff to internal, not sure it needs to be public. 2012-12-12 00:17:59 +05:00
Shannon Deminick
feff68ada8 Refactor new Services for thread safety, plus unit tests. Not all services are updated to be correct, only the
ContentService, the rest need to be updated as well.
2012-12-11 12:03:36 +05:00
Morten Christensen
4f5c5cfc7c Making minor correct to ServiceContext as per Shannons recommendation.
Adding resolver reset to publishing test tear down.
2012-12-10 08:44:17 -01:00
Shannon Deminick
e6f50c2fa4 removed comments 2012-12-10 03:15:12 +05:00
Shannon Deminick
c9f40a74de Changed all data services to create one repository type in the constructor instead of resolving
them in each method since they are only supposed to be using their single unit of work anyways (resolving
will return the same repository anyways, but in some cases it might have been with a different UOW)
Removed SetUnitOfWork method on IRepository as this is not needed.
Removed the old implementation of RepositoryResolver and replaces it with the RepositoryInstanceResolver (but
maintained the name of RepositoryResolver)
2012-12-10 02:58:23 +05:00
Shannon Deminick
f55d639514 Simplifies the ResolveByType so that it only requires the one interface, this is done by adding a new non-generic
IRepository interface.
2012-12-09 09:21:26 +05:00
Shannon Deminick
c3c62f916c Added SetRepositoryInstanceFactory method so that in the future devs could set their own RepositoryInstanceFactory on startup. 2012-12-09 09:07:50 +05:00
Shannon Deminick
e0a7be7237 Created RepositoryInstanceResolver/Factory to replace the configuration based instantiation of Repo's.
Added unit tests to support resoling each instance, fixed CodeFirstTests to ensure that the base.TearDown() method is
called. Changed the BaseMapper's to internal.
2012-12-09 09:01:00 +05:00
Morten Christensen
9111f811be Implementing the new DefinitionFactory, which makes use of the newer database model definitions. This is done to streamline the usage of the database model definitions between db creation and migration. 2012-12-07 14:52:54 -01:00
Morten Christensen
736fbc6659 Moving database definition models, so they are shared and can be used in the sql syntax provider. 2012-12-07 13:48:38 -01:00
Morten Christensen
f9403f2bc6 Implementing fluent Delete, Rename and Update syntax for migrations. 2012-12-07 13:46:11 -01:00
Morten Christensen
9935abd1a2 Implementing Insert-builder with fluent syntax 2012-12-07 12:23:03 -01:00
Morten Christensen
97509316ba Was missing initial wire up of the Create builder's fluent syntax 2012-12-07 12:02:56 -01:00
Morten Christensen
e9d1747504 Adding Fluent Create-builders for Column, Table, Index and ForeignKey. 2012-12-07 11:55:41 -01:00
Sebastiaan Janssen
6a92b400b8 Open connection before checking if table exists 2012-12-05 14:43:37 -01:00
Morten Christensen
8210666d30 Refactoring identity inserts in db creation phase to support mysql 2012-12-05 14:18:08 -01:00
Morten Christensen
8a9cbd0524 Cleaning out old transaction commit code 2012-12-05 12:47:28 -01:00
Morten Christensen
89bcbdb0f3 Moving db transaction up one level to improve installation, which failed for sql azure. 2012-12-05 12:37:00 -01:00
Morten Christensen
602e3260fa Fixing foreignkey issues 2012-12-05 08:39:31 -01:00
Morten Christensen
28d9784c1b Reverting changes to DTOs to re-enable foreign key constraints.
Adding temporary condition to executing database schema creation code to skip foreign key constraints for sql ce.
2012-12-04 08:16:10 -01:00
Morten Christensen
952e4914c5 Merge 2012-12-04 07:37:10 -01:00
Morten Christensen
2c2177fcc7 Creating a new DefinitionFactory for refactoring the database definitions used by the syntax provider. 2012-12-04 07:36:51 -01:00
Sebastiaan Janssen
b02ad9e698 Remove foreign keys that never used to be in 4.x.
Fix the datacreation of CmsTaskTypeData
2012-12-03 13:22:23 -01:00
Morten Christensen
213451e442 Implementing the MigrationRunner, which will be used for database upgrades.
Refactoring a few bits in the syntax of the migration models.
Adding an extension of the PluginManager to find migrations by Type and Attribute.
2012-11-30 18:48:20 -01:00
Morten Christensen
d05a8e0390 Creating DbTypeMap for formatting type in expression 2012-11-30 17:56:02 -01:00
Morten Christensen
f59f57fd6a Initial work on fluent database migrations 2012-11-30 15:01:52 -01:00
Morten Christensen
152c8e810d Working with unit tests and making a few corrections around ContentTypes. 2012-11-30 09:34:09 -01:00
Sebastiaan Janssen
40e7b9bc0a Fix the DB creation and population (tested only on SQL CE so far) 2012-12-03 11:49:09 -01:00
Morten Christensen
acb909c706 Refactoring installer to use the DatabaseContext for installing the umbraco db schema and default data.
Minimizing the use of the json/ajax calls during installation.
2012-11-29 12:40:48 -01:00
Morten Christensen
6edea4a8ee Adding some of the database changes that is part of v6 - just renaming a few columns so far.
Refactoring the installer, which is not working 100% yet.
2012-11-27 15:07:53 -01:00
Morten Christensen
5233dff63f Workaround for database setup in the installer, cause medium trust won't play nice. 2012-11-27 11:38:09 -01:00
Morten Christensen
7641bafd17 Refactoring installer 2012-11-26 17:58:42 -01:00
Morten Christensen
e5ec9eb06f Reducing the usage of the DatabaseFactory 2012-11-26 17:20:58 -01:00
Morten Christensen
7140922e7a Refactoring installer to use the new datalayer for installation. 2012-11-26 15:57:03 -01:00
Morten Christensen
92913389b8 Fixing an issue I had introduced in ExpressionHelper 2012-11-26 14:13:50 -01:00
Morten Christensen
00f2458edd Adding a few unit tests to verify the outcome of the generated sql syntax for the Content- and ContentType repositories. 2012-11-26 12:28:59 -01:00
Morten Christensen
3fe1975514 Refactoring usages of umbraco.GlobalSettings.CurrentVersion to use the new Umbraco.Core.Configuration.GlobalSettings.Version 2012-11-26 09:57:05 -01:00
Morten Christensen
e07fc8c2ba Adding language column to cmsContentVersion 2012-11-26 09:02:49 -01:00