コード例 #1
0
ファイル: PrincipalHelper.cs プロジェクト: oklancir/Rhetos
        /// <summary>
        /// These method allows using the generated class Common.Principal, without referencing
        /// additional plugin assemblies with a custom interface that the Common.Principal class could implement.
        /// For example, standard code that calls repository Load or Save would result with the following compiler error
        /// if the Rhetos server contains the 'SimpleSPRTEmail' plugin:
        /// "The type 'IPrincipalWithEmail' is defined in an assembly that is not referenced.You must add a reference to assembly 'Rhetos.AspNetFormsAuth.SimpleSPRTEmail, Version=2.0.1.0, Culture=neutral, PublicKeyToken=null'."
        /// </summary>
        public static IPrincipal InsertPrincipalOrReadId(this Common.ExecutionContext context, string name)
        {
            var generic = GenericPrincipal(context);
            var item    = generic.CreateInstance();

            item.Name = name;
            generic.InsertOrReadId(item, p => p.Name);
            return(item);
        }
コード例 #2
0
ファイル: UniqueTest.cs プロジェクト: kmeze/Rhetos
 public EntityHelper(RhetosTestContainer container)
 {
     _executionContext = container.Resolve<Common.ExecutionContext>();
     _repository = container.Resolve<Common.DomRepository>();
 }
コード例 #3
0
ファイル: UniqueTest.cs プロジェクト: quocngo2cs/Rhetos
 public EntityHelper(RhetosTestContainer container)
 {
     _executionContext = container.Resolve <Common.ExecutionContext>();
     _repository       = container.Resolve <Common.DomRepository>();
 }
コード例 #4
0
ファイル: UniqueTest.cs プロジェクト: koav/Rhetos
 public EntityHelperMultiple(Common.ExecutionContext executionContext, Common.DomRepository repository)
 {
     _executionContext = executionContext;
     _repository = repository;
 }
コード例 #5
0
 public EntityHelper(UnitOfWorkScope scope)
 {
     _executionContext = scope.Resolve <Common.ExecutionContext>();
     _repository       = scope.Resolve <Common.DomRepository>();
 }
コード例 #6
0
ファイル: PrincipalHelper.cs プロジェクト: oklancir/Rhetos
 /// <summary>
 /// These method allows using the generated class Common.Principal, without referencing
 /// additional plugin assemblies with a custom interface that the Common.Principal class could implement.
 /// For example, standard code that calls repository Load or Save would result with the following compiler error
 /// if the Rhetos server contains the 'SimpleSPRTEmail' plugin:
 /// "The type 'IPrincipalWithEmail' is defined in an assembly that is not referenced.You must add a reference to assembly 'Rhetos.AspNetFormsAuth.SimpleSPRTEmail, Version=2.0.1.0, Culture=neutral, PublicKeyToken=null'."
 /// </summary>
 public static GenericRepository <IPrincipal> GenericPrincipal(this Common.ExecutionContext context)
 {
     return(context.GenericRepository <IPrincipal>("Common.Principal"));
 }