Advertisement
Guest User

Untitled

a guest
Jun 8th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. using Microsoft.WindowsAzure.Storage.Table;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Runtime.Serialization;
  6. using System.ServiceModel;
  7. using System.ServiceModel.Web;
  8. using System.Text;
  9.  
  10. namespace WCFServiceWebRole1
  11. {
  12. // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
  13. [ServiceContract]
  14. public interface IService1
  15. {
  16.  
  17. [OperationContract]
  18. string GetData(int value);
  19.  
  20. [OperationContract]
  21. UserDto AddUser(UserDto user);
  22.  
  23. [OperationContract]
  24. UserDto CheckUser(string username);
  25.  
  26. [OperationContract]
  27. void AddFile(string file, string filename);
  28.  
  29. [OperationContract]
  30. string GetFile(string filename);
  31.  
  32. [OperationContract]
  33. string ListFiles();
  34.  
  35. [OperationContract]
  36. CompositeType GetDataUsingDataContract(CompositeType composite);
  37.  
  38. // TODO: Add your service operations here
  39. }
  40.  
  41.  
  42. // Use a data contract as illustrated in the sample below to add composite types to service operations.
  43. [DataContract]
  44. public class CompositeType
  45. {
  46. bool boolValue = true;
  47. string stringValue = "Hello ";
  48.  
  49. [DataMember]
  50. public bool BoolValue
  51. {
  52. get { return boolValue; }
  53. set { boolValue = value; }
  54. }
  55.  
  56. [DataMember]
  57. public string StringValue
  58. {
  59. get { return stringValue; }
  60. set { stringValue = value; }
  61. }
  62. }
  63.  
  64.  
  65.  
  66. [DataContract]
  67. public class UserDto
  68. {
  69. string username;
  70. string password;
  71.  
  72. [DataMember]
  73. public string Username
  74. {
  75. get { return username; }
  76. set { username = value; }
  77. }
  78.  
  79. [DataMember]
  80. public string Password
  81. {
  82. get { return password; }
  83. set { password = value; }
  84. }
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement