CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla/Server/ObjectFactoryLoader.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ObjectFactoryLoader.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Class containing the default implementation for</summary>
7//-----------------------------------------------------------------------
8using System;
9using Csla.Properties;
11
12namespace Csla.Server
13{
19 {
24 public ObjectFactoryLoader(ApplicationContext applicationContext)
25 {
26 ApplicationContext = applicationContext;
27 }
28
29 private ApplicationContext ApplicationContext { get; set; }
30
40 public Type GetFactoryType(string factoryName)
41 {
42 return Type.GetType(factoryName);
43 }
44
59 public object GetFactory(string factoryName)
60 {
61 var ft = GetFactoryType(factoryName);
62 if (ft == null)
63 throw new InvalidOperationException(
64 string.Format(Resources.FactoryTypeNotFoundException, factoryName));
66 }
67 }
68}
Provides consistent context information between the client and server DataPortal objects.
object CreateInstanceDI(Type objectType, params object[] parameters)
Creates an object using 'Activator.CreateInstance' using service provider (if one is available) to po...
A strongly-typed resource class, for looking up localized strings, etc.
static string FactoryTypeNotFoundException
Looks up a localized string similar to Factory type or assembly could not be loaded ({0}).
Class containing the default implementation for the FactoryLoader delegate used by the data portal ho...
ObjectFactoryLoader(ApplicationContext applicationContext)
Creates an instance of the type.
object GetFactory(string factoryName)
Creates an instance of an object factory object for use by the data portal.
Type GetFactoryType(string factoryName)
Gets the type of the object factory.
Defines an interface to be implemented by a factory loader object that returns ObjectFactory objects ...