public PersonController( ITypeAdapterFactory adapterFactory, IPersonService personService ) { _adapter = adapterFactory.Create(); _personService = personService; }
/// <summary> /// Create a new type adapter from currect factory /// </summary> /// <returns>Created type adapter</returns> public static ITypeAdapter CreateAdapter() { if (currentTypeAdapterFactory == null) { throw new InvalidOperationException("No current type adapter factory available."); } return(currentTypeAdapterFactory.Create()); }
/// <summary> /// Create a new type adapter from currect factory /// </summary> /// <returns>Created type adapter</returns> public static ITypeAdapter CreateAdapter() { if (currentAdapter == null) { currentAdapter = currentTypeAdapterFactory.Create(); } return(currentAdapter); }
/// <summary> /// Create a new type adapter from current factory /// </summary> /// <returns>Created type adapter</returns> public static ITypeAdapter Create() { if (_currentTypeAdapterFactory == null) { throw new ArgumentNullException(nameof(_currentTypeAdapterFactory)); } return(_currentTypeAdapterFactory.Create()); }
public static ITypeAdapter Create() { if (currentTypeAdapterFactory == null) { throw new NullReferenceException("Uma instância de ITypeAdapterFactory deve ser fornecida através do método SetCurrent(ITypeAdapterFactory typeAdapterFactory)."); } return(currentTypeAdapterFactory.Create()); }
/// <summary> /// Create a new type adapter from currect factory /// </summary> /// <returns>Created type adapter</returns> public static ITypeAdapter CreateAdapter() { if (_currentTypeAdapterFactory == null) { lock (lock_flag) { if (_currentTypeAdapterFactory == null) { _currentTypeAdapterFactory = ObjectContainer.CreateInstance <ITypeAdapterFactory>(); } } } return(_currentTypeAdapterFactory.Create()); }
/// <summary> /// Create a new type adapter from currect factory /// </summary> /// <returns>Created type adapter</returns> public static ITypeAdapter CreateAdapter() { return(_currentTypeAdapterFactory.Create()); }
public static ITypeAdapter CreateAdapter() { return((_currentTypeAdapterFactory != null) ? _currentTypeAdapterFactory.Create() : null); }
public static ITypeAdapter Create() { return(_factory.Create()); }