Exemplo n.º 1
0
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.Register(c => DataWebServiceFactory.Create()).As <IDataWebServiceClient>();
            builder.Register(c => SecurityWebServiceFactory.Create()).As <ISecurityWebServiceClient>();

            builder.RegisterGeneric(typeof(AmplaRepository <>)).As(typeof(IRepository <>));
            builder.RegisterGeneric(typeof(AmplaRepository <>)).Named("repository", typeof(IRepository <>));
            builder.RegisterGeneric(typeof(AmplaReadOnlyRepository <>)).As(typeof(IReadOnlyRepository <>));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the Dynamic binder for the Find and FindById dynamic methods
        /// </summary>
        /// <param name="binder">The binder.</param>
        /// <param name="args">The arguments.</param>
        /// <returns></returns>
        public override IDynamicBinder GetBinder(InvokeMemberBinder binder, object[] args)
        {
            if (MethodCalled(binder, "Find"))
            {
                if (NamedIdArgument.Matches(binder, args) || Position0Argument.Matches(binder, args))
                {
                    return(new FindByIdDynamicBinder(DataWebServiceFactory.Create(), CredentialsProvider.ForUsernameAndPassword("User", "password")));
                }
            }

            if (MethodCalled(binder, "FindById"))
            {
                if (Position0Argument.Matches(binder, args) || NamedIdArgument.Matches(binder, args))
                {
                    return(new FindByIdDynamicBinder(DataWebServiceFactory.Create(), CredentialsProvider.ForUsernameAndPassword("User", "password")));
                }
            }
            return(null);
        }
 public DynamicViewPointOperations(DynamicViewPoint viewPoint) : this(viewPoint, DataWebServiceFactory.Create(), CredentialsProvider.ForUsernameAndPassword("User", "password"))
 {
 }