This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note the OperationHasAsyncVersion attribute | |
[ServiceContract(Name = "IService")] | |
interface IService | |
{ | |
[OperationContract] | |
[OperationHasAsyncVersion] | |
string Echo(string req); | |
Task<string> EchoAsync(string req); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.ServiceModel; | |
using System.ServiceModel.Web; | |
using System.Text; | |
namespace Drafts | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"html"._( | |
"body"._( | |
"table"._( | |
"tr"._( | |
from colName in _colNames | |
select "th"._(colName)), | |
from e in _seq | |
select "tr"._( | |
from f in _colFuncs | |
select "td"._( f(e)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static HttpHostConfiguration GetConfig2() | |
{ | |
var provider = new ProcessorProviderOf<TheService>() | |
.RemoveDefaultMediaTypeProcessors() | |
.ForAllOperations() | |
.UseRequestProcessors( | |
(o,l,m) => new DataValidationProcessor(o), | |
(o,l,m) => new RequestLoggingProcessor(o) | |
) | |
.And() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void epz_addMod(epz_ptr res, cepz_ptr op1, cepz_ptr op2, cepz_ptr mod){ | |
ZREQUIRE1(STANDARD_RESIDUE(op1, mod) && STANDARD_RESIDUE(op2, mod)); | |
ZREQUIRE0(POSITIVE(mod)); | |
ZREQUIRE0(res != mod); | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace WcfWebApi.Preview4.Explorations.MessageHandlers | |
{ | |
class ProxyMessageHandler : DelegatingChannel | |
{ | |
private readonly HttpClient _client = new HttpClient(); | |
public ProxyMessageHandler(HttpMessageChannel innerChannel) | |
: base(innerChannel) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ServiceContract] | |
class TheResolverTestService | |
{ | |
[WebGet(UriTemplate="op1/{prm1}/{prm2}")] | |
public void Oper1(string prm1, int prm2) | |
{ | |
} | |
[WebGet(UriTemplate = "op2/{prm1}/middle/{prm2}")] | |
[OperationContract(Name="op2")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultipleServicesForTheSameBinding | |
{ | |
[ServiceContract] | |
interface IAServiceContract | |
{ | |
[OperationContract] | |
string Get(); | |
} | |
class AService : IAServiceContract{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ServiceContract] | |
internal class TheService | |
{ | |
[WebInvoke(UriTemplate = "*", Method = "*")] | |
public void TheOperation(Stream s) | |
{ | |
byte[] buf = new byte[4*1024]; | |
int blen; | |
int len = 0; | |
while ((blen = s.Read(buf, 0, buf.Length))>0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void Fact1() | |
{ | |
var namedAlice = new UserNameClaim("Alice"); | |
var teacher = new RoleClaim("Teacher"); | |
var student = new RoleClaim("Student"); | |
var alice = Claims.Identity(new UserNameClaim("Alice"), student); | |
var bob = Claims.Identity(new UserNameClaim("Bob"), teacher); | |
var anotherAlice = Claims.Identity(new UserNameClaim("Alice")); |
OlderNewer