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); } } } }
public RegistrationService(IDIKernel diKernel) : base(diKernel) { DefaultCandidateRole = diKernel.Get <IRoleRepository>().GetByName("Patient"); }
protected Core(IDIKernel di_kernel, ICoreKernel core_kernel) { DIKernel = di_kernel; CoreKernel = core_kernel; Logger = DIKernel.Get <ILogger>(); }
protected Core(IDIKernel di_kernel) { DIKernel = di_kernel; Logger = DIKernel.Get<ILogger>(); }
protected Core(IDIKernel di_kernel, ICoreKernel core_kernel) { DIKernel = di_kernel; CoreKernel = core_kernel; Logger = DIKernel.Get<ILogger>(); }
public RegistrationService(IDIKernel diKernel) : base(diKernel) { DefaultCandidateRole = diKernel.Get<IRoleRepository>().GetByName("Patient"); }
protected Core(IDIKernel di_kernel) { DIKernel = di_kernel; Logger = DIKernel.Get <ILogger>(); }