-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1068 from navozenko/fix-data-contract-name
Handle DataContract.Name on generic type
- Loading branch information
Showing
3 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/SoapCore.Tests/Wsdl/Services/IGenericDataContractService.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
using System.ServiceModel; | ||
|
||
namespace SoapCore.Tests.Wsdl.Services | ||
{ | ||
[ServiceContract] | ||
public interface IGenericDataContractService | ||
{ | ||
[OperationContract] | ||
GenericDataContractService.MyType<string> TestString(); | ||
|
||
[OperationContract] | ||
GenericDataContractService.MyType<GenericDataContractService.MyArg> TestMyArg(); | ||
} | ||
|
||
public class GenericDataContractService : IGenericDataContractService | ||
{ | ||
public MyType<string> TestString() => throw new NotImplementedException(); | ||
|
||
public MyType<MyArg> TestMyArg() => throw new NotImplementedException(); | ||
|
||
[DataContract(Name = "My{0}Type", Namespace = "http://testnamespace.org")] | ||
public class MyType<T> | ||
{ | ||
[DataMember] | ||
public T Value { get; set; } | ||
} | ||
|
||
public class MyArg | ||
{ | ||
public string Value { get; set; } | ||
} | ||
} | ||
} |
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
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