/// <summary> /// Maps the properties to object. /// </summary> /// <param name="obj">The obj.</param> /// <param name="service">The service.</param> /// <param name="context">The context.</param> public void MapPropertiesToObject(object obj, IAbstractService service, AbstractTypeCreationContext context) { try { //create properties AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj); foreach (var prop in Properties) { try { prop.Mapper.MapCmsToProperty(dataMappingContext); } catch (Exception e) { throw new MapperException( "Failed to map property {0} on {1}".Formatted(prop.PropertyInfo.Name, prop.PropertyInfo.DeclaringType.FullName), e); } } } catch (Exception ex) { throw new MapperException( "Failed to map properties on {0}.".Formatted(context.DataSummary()), ex); } }
/// <summary> /// The default constructor Inheriteda and implemented by all Child classes /// </summary> /// <param name="_service"></param> protected BaseModalsVM(IAbstractService <T> _service, IDinkeyDongleService _dongleService) { service = _service; dongleService = _dongleService; ProcessCommand = new RelayCommand(async() => await Process(), () => CanProcess); CloseCommand = new RelayCommand(Close); }
/// <summary> /// Maps the properties to object. /// </summary> /// <param name="obj">The obj.</param> /// <param name="service">The service.</param> /// <param name="context">The context.</param> public void MapPropertiesToObject(object obj, IAbstractService service, AbstractTypeCreationContext context) { //create properties AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj); foreach (var prop in Properties) { prop.Mapper.MapCmsToProperty(dataMappingContext); } }
/// <summary> /// Initializes a new instance of the <see cref="ObjectSavingArgs"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="target">The target.</param> /// <param name="savingContext">The saving context.</param> /// <param name="service">The service.</param> public ObjectSavingArgs( Context context, object target, AbstractTypeSavingContext savingContext, IAbstractService service) : base(context) { Target = target; SavingContext = savingContext; Service = service; }
/// <summary> /// Initializes a new instance of the <see cref="ObjectConstructionArgs"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="abstractTypeCreationContext">The abstract type creation context.</param> /// <param name="configuration">The configuration.</param> /// <param name="service">The service.</param> public ObjectConstructionArgs( Context context, AbstractTypeCreationContext abstractTypeCreationContext, AbstractTypeConfiguration configuration, IAbstractService service) : base(context) { AbstractTypeCreationContext = abstractTypeCreationContext; Configuration = configuration; Service = service; }
/// <summary> /// Initializes a new instance of the <see cref="ObjectConstructionArgs"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="abstractTypeCreationContext">The abstract type creation context.</param> /// <param name="configuration">The configuration.</param> /// <param name="service">The service.</param> public ObjectConstructionArgs( Context context, AbstractTypeCreationContext abstractTypeCreationContext, AbstractTypeConfiguration configuration, IAbstractService service) : base(context) { AbstractTypeCreationContext = abstractTypeCreationContext; Configuration = configuration; Service = service; }
/// <summary> /// Initializes a new instance of the <see cref="ObjectSavingArgs"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="target">The target.</param> /// <param name="savingContext">The saving context.</param> /// <param name="service">The service.</param> public ObjectSavingArgs( Context context, object target, AbstractTypeSavingContext savingContext, IAbstractService service) : base(context) { Target = target; SavingContext = savingContext; Service = service; }
/// <summary> /// Default constructor for this class and should be implemented /// by all derived classes /// </summary> /// <param name="_service"> /// the default Service class that manages the Type inferred from the Argument passed to the /// class /// </param> protected CollectionsVMWithOneCommand(IAbstractService <T> _service, IDinkeyDongleService _dongleService) { ChangeStyle(string.Empty); service = _service; dongleService = _dongleService; ProcessCommand = new RelayCommand(Process); LoadAll().ConfigureAwait(false); }
/// <summary> /// Maps the properties to object. /// </summary> /// <param name="obj">The obj.</param> /// <param name="service">The service.</param> /// <param name="context">The context.</param> public void MapPropertiesToObject(object obj, IAbstractService service, AbstractTypeCreationContext context) { try { if (_properties.Count != 0) { //create properties AbstractDataMappingContext dataMappingContext = context.CreateDataMappingContext(obj); foreach (var property in _properties.Values) { var prop = property; try { prop.Mapper.MapCmsToProperty(dataMappingContext); } catch (MapperStackException) { throw; } catch (Exception e) { throw new MapperException( "Failed to map property {0} on {1}".Formatted(prop.PropertyInfo.Name, prop.PropertyInfo.DeclaringType.FullName), e); } } } } catch (MapperStackException) { throw; } catch (Exception ex) { throw new MapperException( "Failed to map properties on {0}.".Formatted(context.DataSummary()), ex); } MapPrivatePropertiesToObject(obj, service, context); }
/// <summary> /// Maps the properties to object. /// </summary> /// <param name="obj">The obj.</param> /// <param name="service">The service.</param> /// <param name="context">The context.</param> public void MapPropertiesToObject(object obj, IAbstractService service, AbstractTypeCreationContext context) { try { //create properties AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj); _propertMappingExpression(obj, dataMappingContext); //var tasks = Properties.Select(x => // { // var t = new Task(() => x.Mapper.MapCmsToProperty(dataMappingContext)); // t.Start(); // return t; // }); //Task.WaitAll(tasks.ToArray()); //for(int i = Properties.Length-1; i >= 0; i--) //{ // var prop = Properties[i]; // try // { // prop.Mapper.MapCmsToProperty(context); // } // catch (Exception e) // { // throw new MapperException( // "Failed to map property {0} on {1}".Formatted(prop.PropertyInfo.Name, // prop.PropertyInfo.DeclaringType.FullName), e); // } //} } catch (Exception ex) { throw new MapperException( "Failed to map properties on {0}.".Formatted(context.DataSummary()), ex); } }
public void Build() { _AuthenticationService.BaseUrl = _Configuration.ConsultaAcademicaApiURL; _Authentication = _AuthenticationService.Autenticar( _Configuration.ConsultaAcademicaApiUsername, _Configuration.ConsultaAcademicaApiPassword ); if (!_Authentication.Autenticado) { throw new UnauthorizedAccessException("O usuário e senha informados são inválidos"); } var keys = _Services.Keys; foreach (var key in keys) { IAbstractService service = _Services[key]; service.BaseUrl = _Configuration.ConsultaAcademicaApiURL; service.Token = _Authentication.Token; } }
public BaseConsultaAcademicaProxy(IAbstractService abstractService) : base(abstractService) { ConsultaAcademicaService = (IConsultaAcademicaService)Service; }
/// <summary> /// Initializes a new instance of the <see cref="ConfigurationResolverArgs"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="abstractTypeCreationContext">The abstract type creation context.</param> public ConfigurationResolverArgs(Context context, AbstractTypeCreationContext abstractTypeCreationContext, Type requestedType, IAbstractService service) :base(context) { Service = service; AbstractTypeCreationContext = abstractTypeCreationContext; RequestedType = requestedType; }
public override AbstractDataMappingContext CreateDataMappingContext(IAbstractService service) { var mappingContext = new SitecoreDataMappingContext(Object, Item, service as ISitecoreService, null); return(mappingContext); }
/// <summary> /// Maps the properties to object. /// </summary> /// <param name="obj">The obj.</param> /// <param name="service">The service.</param> /// <param name="context">The context.</param> public void MapPropertiesToObject( object obj, IAbstractService service, AbstractTypeCreationContext context) { try { //create properties AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj); _propertMappingExpression(obj, dataMappingContext); //var tasks = Properties.Select(x => // { // var t = new Task(() => x.Mapper.MapCmsToProperty(dataMappingContext)); // t.Start(); // return t; // }); //Task.WaitAll(tasks.ToArray()); //for(int i = Properties.Length-1; i >= 0; i--) //{ // var prop = Properties[i]; // try // { // prop.Mapper.MapCmsToProperty(context); // } // catch (Exception e) // { // throw new MapperException( // "Failed to map property {0} on {1}".Formatted(prop.PropertyInfo.Name, // prop.PropertyInfo.DeclaringType.FullName), e); // } //} } catch (Exception ex) { throw new MapperException( "Failed to map properties on {0}.".Formatted(context.DataSummary()), ex); } }
public AbstractController(IAbstractService service) { Service = service; }
public AbstractServiceBuilder AddService(IAbstractService service) { _Services.Add(service.ServiceName, service); return(this); }
public StatusController(IAbstractService service) : base(service) { }
public DesignController(IAbstractService <T> illustrationsService) { this.DataServiceService = illustrationsService ?? throw new ArgumentNullException("IllustrationsService cannot be null."); }
public abstract AbstractDataMappingContext CreateDataMappingContext(IAbstractService service);
public GlassModelCounter(IAbstractService service, string identifier) :this(service, identifier, 0) { }
public GlassModelCounter(IAbstractService service, string identifier, int threshold) :this(service.GlassContext, identifier, threshold) { }
/// <summary> /// Maps the properties to object. /// </summary> /// <param name="obj">The obj.</param> /// <param name="service">The service.</param> /// <param name="context">The context.</param> public void MapPropertiesToObject( object obj, IAbstractService service, AbstractTypeCreationContext context) { try { //create properties AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj); foreach (var prop in Properties) { try { prop.Mapper.MapCmsToProperty(dataMappingContext); } catch (Exception e) { throw new MapperException( "Failed to map property {0} on {1}".Formatted(prop.PropertyInfo.Name, prop.PropertyInfo.DeclaringType.FullName), e); } } } catch (Exception ex) { throw new MapperException( "Failed to map properties on {0}.".Formatted(context.DataSummary()), ex); } }
/// <summary> /// Initializes a new instance of the <see cref="ConfigurationResolverArgs"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="abstractTypeCreationContext">The abstract type creation context.</param> public ConfigurationResolverArgs(Context context, AbstractTypeCreationContext abstractTypeCreationContext, IAbstractService service) : base(context) { Service = service; AbstractTypeCreationContext = abstractTypeCreationContext; }
/// <summary> /// Maps the properties to object. /// </summary> /// <param name="obj">The obj.</param> /// <param name="service">The service.</param> /// <param name="context">The context.</param> public void MapPropertiesToObject( object obj, IAbstractService service, AbstractTypeCreationContext context) { //create properties AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj); foreach (var prop in Properties) { prop.Mapper.MapCmsToProperty(dataMappingContext); } }
public BaseParallelConsultaAcademicaProxy(IAbstractService abstractService) : base(abstractService) { ConsultaAcademicaService = (IConsultaAcademicaService)Service; UseParallelism = false; CanLog = false; }
public GlassModelCounter(IAbstractService service, string identifier, int threshold) : this(service.GlassContext, identifier, threshold) { }
/// <summary> /// The default constructor inherited from the base class and should be implemented /// by all derived classes /// </summary> /// <param name="_service"> /// the default Service class that manages the Type inferred from the Argument passed to the /// class /// </param> protected CollectionsVMWithTwoCommands(IAbstractService <T> _service, IDinkeyDongleService _dongleService) : base(_service: _service, _dongleService: _dongleService) { FilterCollectionsCommand = new RelayCommand <object>(FilterCollections); }
public GlassModelCounter(IAbstractService service, string identifier) : this(service, identifier, 0) { }
public CatController(ICategoryService salesOrderService, IAbstractService <CategoryMaster> salesOrderLineService) { _salesOrderService = salesOrderService; _salesOrderLineService = salesOrderLineService; }
/// <summary> /// Initializes a new instance of the <see cref="ConfigurationResolverArgs"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="abstractTypeCreationContext">The abstract type creation context.</param> public ConfigurationResolverArgs(Context context, AbstractTypeCreationContext abstractTypeCreationContext, Type requestedType, IAbstractService service) : base(context) { Service = service; AbstractTypeCreationContext = abstractTypeCreationContext; RequestedType = requestedType; }
public AbstractProxy(IAbstractService abstractService) { Service = abstractService; }