예제 #1
0
 public CandidatesFakeRepository(IDIKernel di_kernel) : base(di_kernel)
 {
     Save(new Candidate
     {
         Birthday = new DateTime(1980, 12, 2),
         //Card = "some card number",
         FirstName = "cand1",
         LastName  = "cand1",
         Login     = "******",
         Password  = "******",
         //Policy = "some policy number",
         Role      = di_kernel.Get <IRoleRepository>().GetByName("Patient"),
         ThirdName = "cand1",
         Mother    = "mother1",
         //Father = "father1"
     });
     Save(new Candidate
     {
         Birthday = new DateTime(1980, 12, 2),
         //Card = "some card number",
         FirstName = "cand2",
         LastName  = "cand2",
         Login     = "******",
         Password  = "******",
         //Policy = "some policy number",
         Role      = di_kernel.Get <IRoleRepository>().GetByName("Patient"),
         ThirdName = "cand2",
         Mother    = "mother2",
         //Father = "father2"
     });
 }
        public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
        {
            var  repository   = _diKernel.Get <DynamicMetadataRepository>();
            Type metadataType = repository.GetMetadataType(objectType);

            if (metadataType == null)
            {
                return(base.GetTypeDescriptor(objectType, instance));
            }
            return
                (new DynamicTypeDescriptor(base.GetTypeDescriptor(objectType, instance), metadataType));
        }
 private void FindModelMetadataForType(Type modelType)
 {
     PropertyInfo[] propertyInfos = modelType.GetProperties();
     foreach (PropertyInfo propertyInfo in propertyInfos)
     {
         if (propertyInfo.PropertyType.Namespace != typeof(int).Namespace)
         {
             if (propertyInfo.PropertyType == _for)
             {
                 FindModelMetadataForType(_use);
                 continue;
             }
             var attribute =
                 propertyInfo.GetCustomAttributes(typeof(ClassMetadataAttribute), true).FirstOrDefault() as
                 ClassMetadataAttribute;
             if (attribute != null)
             {
                 _diKernel.Get <DynamicMetadataRepository>().Bind(propertyInfo.PropertyType,
                                                                  attribute.MetadataType);
                 FindModelMetadataForType(attribute.MetadataType);
             }
         }
     }
 }
예제 #4
0
 public RegistrationService(IDIKernel diKernel) : base(diKernel)
 {
     DefaultCandidateRole = diKernel.Get <IRoleRepository>().GetByName("Patient");
 }
예제 #5
0
 protected Core(IDIKernel di_kernel, ICoreKernel core_kernel)
 {
     DIKernel   = di_kernel;
     CoreKernel = core_kernel;
     Logger     = DIKernel.Get <ILogger>();
 }
예제 #6
0
파일: Core.cs 프로젝트: crashr42/Health
 protected Core(IDIKernel di_kernel)
 {
     DIKernel = di_kernel;
     Logger = DIKernel.Get<ILogger>();
 }
예제 #7
0
파일: Core.cs 프로젝트: crashr42/Health
 protected Core(IDIKernel di_kernel, ICoreKernel core_kernel)
 {
     DIKernel = di_kernel;
     CoreKernel = core_kernel;
     Logger = DIKernel.Get<ILogger>();
 }
예제 #8
0
 public RegistrationService(IDIKernel diKernel)
     : base(diKernel)
 {
     DefaultCandidateRole = diKernel.Get<IRoleRepository>().GetByName("Patient");
 }
예제 #9
0
파일: Core.cs 프로젝트: KasunDA/Health-1
 protected Core(IDIKernel di_kernel)
 {
     DIKernel = di_kernel;
     Logger   = DIKernel.Get <ILogger>();
 }