/// <summary> /// Factory (for transient instance) /// </summary> public INakedObjectAdapter CreateInstance(IObjectSpec spec) { if (spec.ContainsFacet(typeof (IComplexTypeFacet))) { throw new TransientReferenceException(Log.LogAndReturn(Resources.NakedObjects.NoTransientInline)); } object obj = CreateObject(spec); INakedObjectAdapter adapter = nakedObjectManager.CreateInstanceAdapter(obj); InitializeNewObject(adapter); return adapter; }
/// <summary> /// Factory (for transient instance) /// </summary> public INakedObjectAdapter CreateInstance(IObjectSpec spec) { if (spec.ContainsFacet(typeof(IComplexTypeFacet))) { throw new TransientReferenceException(Log.LogAndReturn(Resources.NakedObjects.NoTransientInline)); } object obj = CreateObject(spec); INakedObjectAdapter adapter = nakedObjectManager.CreateInstanceAdapter(obj); InitializeNewObject(adapter); return(adapter); }
/// <summary> /// Factory (for transient instance) /// </summary> public virtual INakedObject CreateInstance(IObjectSpec spec) { Log.DebugFormat("CreateInstance of: {0}", spec); if (spec.ContainsFacet(typeof(IComplexTypeFacet))) { throw new TransientReferenceException(Resources.NakedObjects.NoTransientInline); } object obj = CreateObject(spec); INakedObject adapter = nakedObjectManager.CreateInstanceAdapter(obj); InitializeNewObject(adapter); return(adapter); }
public static bool IsCollectionOfEnum(this ITypeSpec spec, IObjectSpec elementSpec) { return(spec.IsCollection && elementSpec.ContainsFacet <IEnumFacet>()); }
public static bool IsCollectionOfEnum(this ITypeSpec spec, IObjectSpec elementSpec) { return spec.IsCollection && elementSpec.ContainsFacet<IEnumFacet>(); }