本文整理汇总了C#中Facade.ToModel方法的典型用法代码示例。如果您正苦于以下问题:C# Facade.ToModel方法的具体用法?C# Facade.ToModel怎么用?C# Facade.ToModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facade
的用法示例。
在下文中一共展示了Facade.ToModel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public HttpResponseMessage Update(Identity id, Facade.GroupPut group)
{
return ProcessPut(() =>
{
var instance = group.ToModel();
updateGroupCommand.Execute(instance);
});
}
示例2: Create
public HttpResponseMessage Create(Facade.SubscriptionPost subscription)
{
return ProcessPost(() =>
{
var instance = subscription.ToModel();
createCommand.Execute(instance);
return ResourceLocation.OfSubscription(instance.Id.Value);
});
}
示例3: Create
public HttpResponseMessage Create(Facade.GroupPost topic)
{
return ProcessPost(() =>
{
var instance = topic.ToModel();
createGroupCommand.Execute(instance);
return ResourceLocation.OfGroup(instance.Id.Value);
});
}
示例4: GetByGroup
public HttpResponseMessage<Facade.Topic[]> GetByGroup(Facade.Identity groupId, int skip, int limit)
{
// set valid values of opional parameters
var validatedSkip = skip > 0 ? skip : new int?();
var validatedLimit = limit > 0 ? limit : new int?();
return ProcessGet(() =>
topicsByGroup.GetTopics(groupId.ToModel(), validatedSkip, validatedLimit)
.Select(item => item.ToFacade())
.ToArray());
}