Ejemplo n.º 1
0
 public static Contracts.Client.IAdapterAccess <I> Create <I>(string sessionToken) where I : Contracts.IIdentifiable
 {
     Contracts.Client.IAdapterAccess <I> result = null;
     if (Adapter == AdapterType.Controller)
     {
         if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.App.IContact))
         {
             result = new Controller.GenericControllerAdapter <QnSContactManager.Contracts.Persistence.App.IContact>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.Account.IRole))
         {
             result = new Controller.GenericControllerAdapter <QnSContactManager.Contracts.Persistence.Account.IRole>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSContactManager.Contracts.Business.Account.IAppAccess))
         {
             result = new Controller.GenericControllerAdapter <QnSContactManager.Contracts.Business.Account.IAppAccess>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
     }
     else if (Adapter == AdapterType.Service)
     {
         if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.App.IContact))
         {
             result = new Service.GenericServiceAdapter <QnSContactManager.Contracts.Persistence.App.IContact, Transfer.Persistence.App.Contact>(sessionToken, BaseUri, "Contact") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.Account.IRole))
         {
             result = new Service.GenericServiceAdapter <QnSContactManager.Contracts.Persistence.Account.IRole, Transfer.Persistence.Account.Role>(sessionToken, BaseUri, "Role") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSContactManager.Contracts.Business.Account.IAppAccess))
         {
             result = new Service.GenericServiceAdapter <QnSContactManager.Contracts.Business.Account.IAppAccess, Transfer.Business.Account.AppAccess>(sessionToken, BaseUri, "AppAccess") as Contracts.Client.IAdapterAccess <I>;
         }
     }
     return(result);
 }
Ejemplo n.º 2
0
        public static Contracts.Client.IAdapterAccess <TContract> Create <TContract, TModel>(string baseUri, string sessionToken)
            where TContract : Contracts.IIdentifiable
            where TModel : TContract, Contracts.ICopyable <TContract>, new()
        {
            Contracts.Client.IAdapterAccess <TContract> result = null;

            result = new Service.GenericServiceAdapter <TContract, TModel>(sessionToken, baseUri, typeof(TModel).Name) as Contracts.Client.IAdapterAccess <TContract>;
            return(result);
        }
Ejemplo n.º 3
0
        public static Contracts.Client.IAdapterAccess <TContract> Create <TContract>()
            where TContract : Contracts.IIdentifiable
        {
            string baseUri = "https://localhost:5001/api";

            Contracts.Client.IAdapterAccess <TContract> result = null;

            if (Adapter == AdapterType.Controller)
            {
                if (typeof(TContract) == typeof(Contracts.Persistence.IGenre))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericControllerAdapter <Contracts.Persistence.IGenre, Transfer.Models.Persistence.Genre>();
                }
                else if (typeof(TContract) == typeof(Contracts.Persistence.IArtist))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericControllerAdapter <Contracts.Persistence.IArtist, Transfer.Models.Persistence.Artist>();
                }
                else if (typeof(TContract) == typeof(Contracts.Persistence.IAlbum))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericControllerAdapter <Contracts.Persistence.IAlbum, Transfer.Models.Persistence.Album>();
                }
                else if (typeof(TContract) == typeof(Contracts.Persistence.ITrack))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericControllerAdapter <Contracts.Persistence.ITrack, Transfer.Models.Persistence.Track>();
                }
                else
                {
                    throw new ArgumentException($"The type {typeof(TContract).FullName} is not supported.");
                }
            }
            else if (Adapter == AdapterType.Service)
            {
                if (typeof(TContract) == typeof(Contracts.Persistence.IGenre))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericServiceAdapter <Contracts.Persistence.IGenre, Transfer.Models.Persistence.Genre>(baseUri, "Genre");
                }
                else if (typeof(TContract) == typeof(Contracts.Persistence.IArtist))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericServiceAdapter <Contracts.Persistence.IArtist, Transfer.Models.Persistence.Artist>(baseUri, "Artist");
                }
                else if (typeof(TContract) == typeof(Contracts.Persistence.IAlbum))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericServiceAdapter <Contracts.Persistence.IAlbum, Transfer.Models.Persistence.Album>(baseUri, "Album");
                }
                else if (typeof(TContract) == typeof(Contracts.Persistence.ITrack))
                {
                    result = (Contracts.Client.IAdapterAccess <TContract>) new GenericServiceAdapter <Contracts.Persistence.ITrack, Transfer.Models.Persistence.Track>(baseUri, "Track");
                }
                else
                {
                    throw new ArgumentException($"The type {typeof(TContract).FullName} is not supported.");
                }
            }
            return(result);
        }
Ejemplo n.º 4
0
        public FieldSetHandler(Pages.ModelPage modelPage, Contracts.Client.IAdapterAccess <TContract> adapterAccess)
        {
            Constructing();
            modelPage.CheckArgument(nameof(modelPage));
            adapterAccess.CheckArgument(nameof(adapterAccess));

            ModelPage     = modelPage;
            AdapterAccess = adapterAccess;

            Translate = ModelPage.Translate;
            Constructed();
        }
Ejemplo n.º 5
0
 public static Contracts.Client.IAdapterAccess <I> Create <I>() where I : Contracts.IIdentifiable
 {
     Contracts.Client.IAdapterAccess <I> result = null;
     if (Adapter == AdapterType.Controller)
     {
         if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.ILoginSession))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.Account.ILoginSession>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IRole))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.Account.IRole>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUser))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.Account.IUser>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUserXRole))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.Account.IUserXRole>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.ILoginUser))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Business.Account.ILoginUser>() as Contracts.Client.IAdapterAccess <I>;
         }
     }
     else if (Adapter == AdapterType.Service)
     {
         if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.ILoginSession))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.Account.ILoginSession, Transfer.Persistence.Account.LoginSession>(BaseUri, "LoginSession") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IRole))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.Account.IRole, Transfer.Persistence.Account.Role>(BaseUri, "Role") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUser))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.Account.IUser, Transfer.Persistence.Account.User>(BaseUri, "User") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUserXRole))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.Account.IUserXRole, Transfer.Persistence.Account.UserXRole>(BaseUri, "UserXRole") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.ILoginUser))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Business.Account.ILoginUser, Transfer.Business.Account.LoginUser>(BaseUri, "LoginUser") as Contracts.Client.IAdapterAccess <I>;
         }
     }
     return(result);
 }
Ejemplo n.º 6
0
 public static Contracts.Client.IAdapterAccess <I> Create <I>(string sessionToken)
 {
     Contracts.Client.IAdapterAccess <I> result = null;
     if (Adapter == AdapterType.Controller)
     {
         if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Persistence.App.ICalendarEntry))
         {
             result = new Controller.GenericControllerAdapter <QnSHolidayCalendar.Contracts.Persistence.App.ICalendarEntry>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Persistence.Account.IRole))
         {
             result = new Controller.GenericControllerAdapter <QnSHolidayCalendar.Contracts.Persistence.Account.IRole>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Business.App.IHolidayEntry))
         {
             result = new Controller.GenericControllerAdapter <QnSHolidayCalendar.Contracts.Business.App.IHolidayEntry>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Business.Account.IAppAccess))
         {
             result = new Controller.GenericControllerAdapter <QnSHolidayCalendar.Contracts.Business.Account.IAppAccess>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
     }
     else if (Adapter == AdapterType.Service)
     {
         if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Persistence.App.ICalendarEntry))
         {
             result = new Service.GenericServiceAdapter <QnSHolidayCalendar.Contracts.Persistence.App.ICalendarEntry, Transfer.Persistence.App.CalendarEntry>(sessionToken, BaseUri, "CalendarEntry") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Persistence.Account.IRole))
         {
             result = new Service.GenericServiceAdapter <QnSHolidayCalendar.Contracts.Persistence.Account.IRole, Transfer.Persistence.Account.Role>(sessionToken, BaseUri, "Role") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Business.App.IHolidayEntry))
         {
             result = new Service.GenericServiceAdapter <QnSHolidayCalendar.Contracts.Business.App.IHolidayEntry, Transfer.Business.App.HolidayEntry>(sessionToken, BaseUri, "HolidayEntry") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Business.Account.IAppAccess))
         {
             result = new Service.GenericServiceAdapter <QnSHolidayCalendar.Contracts.Business.Account.IAppAccess, Transfer.Business.Account.AppAccess>(sessionToken, BaseUri, "AppAccess") as Contracts.Client.IAdapterAccess <I>;
         }
     }
     return(result);
 }
Ejemplo n.º 7
0
 public static Contracts.Client.IAdapterAccess <I> Create <I>() where I : Contracts.IIdentifiable
 {
     Contracts.Client.IAdapterAccess <I> result = null;
     if (Adapter == AdapterType.Controller)
     {
         if (typeof(I) == typeof(QnSTravelCount.Contracts.Business.App.ITravelExpenses))
         {
             result = new Controller.GenericControllerAdapter <QnSTravelCount.Contracts.Business.App.ITravelExpenses>() as Contracts.Client.IAdapterAccess <I>;
         }
     }
     else if (Adapter == AdapterType.Service)
     {
         if (typeof(I) == typeof(QnSTravelCount.Contracts.Business.App.ITravelExpenses))
         {
             result = new Service.GenericServiceAdapter <QnSTravelCount.Contracts.Business.App.ITravelExpenses, Transfer.Business.App.TravelExpenses>(BaseUri, "TravelExpenses") as Contracts.Client.IAdapterAccess <I>;
         }
     }
     return(result);
 }
Ejemplo n.º 8
0
 public static Contracts.Client.IAdapterAccess <I> Create <I>()
 {
     Contracts.Client.IAdapterAccess <I> result = null;
     if (Adapter == AdapterType.Controller)
     {
         if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Language.ITranslation))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Language.ITranslation>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Data.IBinaryData))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Data.IBinaryData>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Configuration.IIdentitySetting))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Configuration.IIdentitySetting>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Configuration.ISetting))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Configuration.ISetting>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IAward))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.App.IAward>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IJuror))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.App.IJuror>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IMember))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.App.IMember>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IProject))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.App.IProject>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IRating))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.App.IRating>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IAccess))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Account.IAccess>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IActionLog))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Account.IActionLog>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IIdentity))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Account.IIdentity>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IIdentityXRole))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Account.IIdentityXRole>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.ILoginSession))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Account.ILoginSession>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IRole))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Account.IRole>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IUser))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Persistence.Account.IUser>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Business.Account.IAppAccess))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Business.Account.IAppAccess>() as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Business.Account.IIdentityUser))
         {
             result = new Controller.GenericControllerAdapter <QnSProjectAward.Contracts.Business.Account.IIdentityUser>() as Contracts.Client.IAdapterAccess <I>;
         }
     }
     else if (Adapter == AdapterType.Service)
     {
         if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Language.ITranslation))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Language.ITranslation, Transfer.Persistence.Language.Translation>(BaseUri, "Translations") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Data.IBinaryData))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Data.IBinaryData, Transfer.Persistence.Data.BinaryData>(BaseUri, "BinaryDatas") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Configuration.IIdentitySetting))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Configuration.IIdentitySetting, Transfer.Persistence.Configuration.IdentitySetting>(BaseUri, "IdentitySettings") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Configuration.ISetting))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Configuration.ISetting, Transfer.Persistence.Configuration.Setting>(BaseUri, "Settings") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IAward))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.App.IAward, Transfer.Persistence.App.Award>(BaseUri, "Awards") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IJuror))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.App.IJuror, Transfer.Persistence.App.Juror>(BaseUri, "Jurors") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IMember))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.App.IMember, Transfer.Persistence.App.Member>(BaseUri, "Members") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IProject))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.App.IProject, Transfer.Persistence.App.Project>(BaseUri, "Projects") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IRating))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.App.IRating, Transfer.Persistence.App.Rating>(BaseUri, "Ratings") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IAccess))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Account.IAccess, Transfer.Persistence.Account.Access>(BaseUri, "Access") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IActionLog))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Account.IActionLog, Transfer.Persistence.Account.ActionLog>(BaseUri, "ActionLogs") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IIdentity))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Account.IIdentity, Transfer.Persistence.Account.Identity>(BaseUri, "Identitys") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IIdentityXRole))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Account.IIdentityXRole, Transfer.Persistence.Account.IdentityXRole>(BaseUri, "IdentityXRoles") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.ILoginSession))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Account.ILoginSession, Transfer.Persistence.Account.LoginSession>(BaseUri, "LoginSessions") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IRole))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Account.IRole, Transfer.Persistence.Account.Role>(BaseUri, "Roles") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IUser))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Persistence.Account.IUser, Transfer.Persistence.Account.User>(BaseUri, "Users") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Business.Account.IAppAccess))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Business.Account.IAppAccess, Transfer.Business.Account.AppAccess>(BaseUri, "AppAccess") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QnSProjectAward.Contracts.Business.Account.IIdentityUser))
         {
             result = new Service.GenericServiceAdapter <QnSProjectAward.Contracts.Business.Account.IIdentityUser, Transfer.Business.Account.IdentityUser>(BaseUri, "IdentityUsers") as Contracts.Client.IAdapterAccess <I>;
         }
     }
     return(result);
 }
Ejemplo n.º 9
0
 public static Contracts.Client.IAdapterAccess <I> Create <I>(string sessionToken)
 {
     Contracts.Client.IAdapterAccess <I> result = null;
     if (Adapter == AdapterType.Controller)
     {
         if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoice))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoice>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoiceDetail))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoiceDetail>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IRole))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.Account.IRole>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUser))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Persistence.Account.IUser>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.TestOneToMany.IInvoiceDetails))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Business.TestOneToMany.IInvoiceDetails>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.IAppAccess))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Business.Account.IAppAccess>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.IIdentityUser))
         {
             result = new Controller.GenericControllerAdapter <QuickNSmart.Contracts.Business.Account.IIdentityUser>(sessionToken) as Contracts.Client.IAdapterAccess <I>;
         }
     }
     else if (Adapter == AdapterType.Service)
     {
         if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoice))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoice, Transfer.Persistence.TestOneToMany.Invoice>(sessionToken, BaseUri, "Invoice") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoiceDetail))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoiceDetail, Transfer.Persistence.TestOneToMany.InvoiceDetail>(sessionToken, BaseUri, "InvoiceDetail") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IRole))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.Account.IRole, Transfer.Persistence.Account.Role>(sessionToken, BaseUri, "Role") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUser))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Persistence.Account.IUser, Transfer.Persistence.Account.User>(sessionToken, BaseUri, "User") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.TestOneToMany.IInvoiceDetails))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Business.TestOneToMany.IInvoiceDetails, Transfer.Business.TestOneToMany.InvoiceDetails>(sessionToken, BaseUri, "InvoiceDetails") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.IAppAccess))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Business.Account.IAppAccess, Transfer.Business.Account.AppAccess>(sessionToken, BaseUri, "AppAccess") as Contracts.Client.IAdapterAccess <I>;
         }
         else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.IIdentityUser))
         {
             result = new Service.GenericServiceAdapter <QuickNSmart.Contracts.Business.Account.IIdentityUser, Transfer.Business.Account.IdentityUser>(sessionToken, BaseUri, "IdentityUser") as Contracts.Client.IAdapterAccess <I>;
         }
     }
     return(result);
 }
 protected override void Constructed()
 {
     RoleAccess = ModelPage.ServiceAdapter.Create <IRole>();
 }