本文整理汇总了C#中IMappingEngine类的典型用法代码示例。如果您正苦于以下问题:C# IMappingEngine类的具体用法?C# IMappingEngine怎么用?C# IMappingEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IMappingEngine类属于命名空间,在下文中一共展示了IMappingEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Context
protected override void Context()
{
AccountService = MockRepository.GenerateStub<IAccountService>();
Identity = new FakeIdentity(Username);
_user = new FakePrincipal(Identity, null);
HttpRequest = MockRepository.GenerateStub<HttpRequestBase>();
HttpContext = MockRepository.GenerateStub<HttpContextBase>();
HttpContext.Stub(x => x.Request).Return(HttpRequest);
HttpContext.User = _user;
_httpResponse = MockRepository.GenerateStub<HttpResponseBase>();
_httpResponse.Stub(x => x.Cookies).Return(new HttpCookieCollection());
HttpContext.Stub(x => x.Response).Return(_httpResponse);
Logger = MockRepository.GenerateStub<ILogger>();
WebAuthenticationService = MockRepository.GenerateStub<IWebAuthenticationService>();
MappingEngine = MockRepository.GenerateStub<IMappingEngine>();
AccountCreator = MockRepository.GenerateStub<IAccountCreator>();
AccountController = new AccountController(AccountService, Logger, WebAuthenticationService, MappingEngine, null, AccountCreator);
AccountController.ControllerContext = new ControllerContext(HttpContext, new RouteData(), AccountController);
}
示例2: MyAccountViewModelBuilder
public MyAccountViewModelBuilder(string userEmail, ICustomerAccountService customerAccountService, IOrderRepository orderRepository, IMappingEngine mapper)
{
this.userEmail = userEmail;
this.customerAccountService = customerAccountService;
this.orderRepository = orderRepository;
this.mapper = mapper;
}
示例3: EmailRingEmailTemplateViewModelBuilder
public EmailRingEmailTemplateViewModelBuilder(EmailRingModel model, IJewelRepository jewelRepository,
IMappingEngine mapper)
{
this.model = model;
this.jewelRepository = jewelRepository;
this.mapper = mapper;
}
示例4: CompositionsViewModelProvider
public CompositionsViewModelProvider(
IImageRepository imageRepository,
IMappingEngine mappingEngine)
{
_imageRepository = imageRepository;
_mappingEngine = mappingEngine;
}
示例5: PrinterMessageProvider
public PrinterMessageProvider(
QueueListenerFactory listenerFactory,
IMappingEngine mappingEngine)
{
_listenerFactory = listenerFactory;
_mappingEngine = mappingEngine;
}
示例6: BorrowerItemController
public BorrowerItemController(IBorrowerItemRepository borrowerItemRepository, IMappingEngine mappingEngine, IBorrowerRepository borrowerRepository, IItemRepository itemRepository)
{
_borrowerItemRepository = borrowerItemRepository;
_mappingEngine = mappingEngine;
_borrowerRepository = borrowerRepository;
_itemRepository = itemRepository;
}
示例7: Initialize
public void Initialize()
{
_uow = A.Fake<IUnitOfWork>();
_mapper = A.Fake<IMappingEngine>();
_service = new HouseService(_uow, _mapper);
// Initializing HouseDTO's
_nonExistingHouseDTO = new HouseDTO();
_existingHouseDTO = new HouseDTO();
_houseWithBookingsDTO = new HouseDTO();
_houseWithNoBookingsDTO = new HouseDTO();
// Initializing Houses
_nonExistingHouse = new House();
_existingHouse = new House();
_houseWithBookings = new House();
_houseWithNoBookings = new House();
// Controlling mapper behaviour
A.CallTo(() => _mapper.Map<House>(_nonExistingHouseDTO)).Returns(_nonExistingHouse);
A.CallTo(() => _mapper.Map<House>(_existingHouseDTO)).Returns(_existingHouse);
A.CallTo(() => _mapper.Map<House>(_houseWithBookingsDTO)).Returns(_houseWithBookings);
A.CallTo(() => _mapper.Map<House>(_houseWithNoBookingsDTO)).Returns(_houseWithNoBookings);
// Controlling service behaviour
A.CallTo(() => _uow.HouseRepository.IsDuplicate(_nonExistingHouse)).Returns(false);
A.CallTo(() => _uow.HouseRepository.IsDuplicate(_existingHouse)).Returns(true);
A.CallTo(() => _uow.HouseRepository.HasBookings(_houseWithBookings)).Returns(true);
A.CallTo(() => _uow.HouseRepository.HasBookings(_houseWithNoBookings)).Returns(false);
}
示例8: TitleService
public TitleService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
{
_userManager = userManager;
_unitOfWork = unitOfWork;
_titles = _unitOfWork.Set<Title>();
_mappingEngine = mappingEngine;
}
示例9: UserModule
public UserModule(IMappingEngine mappingEngine, IReadOnlyRepository readOnlyRepository)
{
Get["/me"] = r => mappingEngine.Map<User, MeResponse>(this.UserSession().User);
Get["/user/exists"] =
r =>
{
bool exists = false;
bool activated = false;
var email = (string) Request.Query.email;
try
{
var user =
readOnlyRepository.First<User>(x => x.Email == email);
exists = true;
activated = user.Activated;
}
catch (ItemNotFoundException<User>)
{
}
return new UserExistenceResponse
{
Exists = exists,
Activated = activated,
};
};
}
示例10: BalanceDateRepository
public BalanceDateRepository(
IModelContextFactory factory,
IMappingEngine mapper)
{
this.factory = factory;
this.mapper = mapper;
}
示例11: ModuleManagedViewModel
public ModuleManagedViewModel(SettingsProvider settingsProvider, IViewModelNavigator navigator,
IMappingEngine mappingEngine)
{
_settingsProvider = settingsProvider;
_navigator = navigator;
_mappingEngine = mappingEngine;
}
示例12: UserModule
public UserModule(IMappingEngine mappingEngine, IReadOnlyRepository readOnlyRepository)
{
Get["/me"] = r =>
{
return mappingEngine.Map<User, MeResponse>(this.UserSession().User);
};
Get["/user/exists"] =
r =>
{
bool exists = false;
bool activated = false;
var facebookid = (long)Request.Query.facebookid;
try
{
var user =
readOnlyRepository.First<User>(x => x.FacebookId == facebookid);
if (user != null)
{
exists = true;
activated = user.Verified;
}
}
catch (ItemNotFoundException<User>)
{
}
return new UserExistenceResponse
{
Exists = exists,
Activated = activated,
};
};
}
示例13: ReportModule
public ReportModule(IReportService reportService, IReportResultService reportResultService, IMappingEngine mappingEngine)
: base("data/reports", mappingEngine, UserRole.Standard)
{
this.reportService = reportService;
this.reportResultService = reportResultService;
Get["/"] = SearchReports;
Get["/{id}"] = GetReport;
Post["/"] = AddReport;
Put["/{id}"] = UpdateReport;
Delete["/{id}"] = DeleteReport;
Put["/{id}/request"] = RequestReport;
Get["/myResults"] = GetMyResults;
Get["/results/{id}"] = ViewReportResults;
Get["/results/{id}/download/{*}"] = DownloadReportResults;
Get["/builder"] = GetReportBuilderData;
Get["/builder/summary"] = GetReportDataSummary;
}
示例14: PersonController
public PersonController(IPersonRepository personRepository, IMappingEngine mappingEngine)
{
if (personRepository == null) throw new ArgumentNullException(nameof(personRepository));
if (mappingEngine == null) throw new ArgumentNullException(nameof(mappingEngine));
this._personRepository = personRepository;
this._mappingEngine = mappingEngine;
}
示例15: MyAccountModule
public MyAccountModule(IUserService userService, IMappingEngine mappingEngine)
: base("data/users", mappingEngine, UserRole.Standard)
{
Get["/myAccount"] = args =>
{
var authorizedUser = Context.GetAuthorizedUser();
var foundUser = userService.Get(authorizedUser.Id);
return MapTo<User>(foundUser);
};
Put["/myAccount"] = args =>
{
var model = this.BindAndValidate<Models.User>();
if (!ModelValidationResult.IsValid)
{
return RespondWithValidationFailure(ModelValidationResult);
}
var authorizedUser = Context.GetAuthorizedUser();
var updateEntity = MapTo<SystemUser>(model);
var updatedUser = userService.UpdateUser(authorizedUser.Id, authorizedUser.Id, updateEntity);
Context.SetupSession(updatedUser);
return MapTo<User>(updatedUser);
};
}