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
if (shippingOptions != null) | |
{ | |
var selectedOption = shippingOptions.SelectedShippingOptionDetails; | |
result.SelectedShippingOption = selectedOption; | |
result.ShowDeliveryMethodInformation = cartResponse.ShippingInfo.RequiresDelivery; | |
result.ShowSelectedShippingOption = selectedOption != null && !string.IsNullOrEmpty(selectedOption.Id); | |
if (_contactsSettings.Current.EndUserContact.Mode != ContactSettingsMode.Off) | |
{ | |
result.ShowEndUserContactInformation = true; | |
} |
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
public class Employee | |
{ | |
public string Fname { get; set; } | |
public string Lname { get; set; } | |
public string Desig { get; set; } | |
} | |
Now, for doing the same, we will add data annotation as shown below in the sample | |
[DataContract] |
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
public interface IEmployee | |
{ | |
string PrintEmployee(Employee empl); | |
} | |
Now, to make the service contract, we need to annotate the same with | |
different attributes as shown below. | |
[ServiceContract] | |
public interface IEmployee |
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
public class WCFDemo : IEmployee | |
{ | |
//Service implementation | |
public string PrintEmployee(Employee empl) | |
{ | |
// Business Logic goes here... | |
return string.Format("Hello Employee {0} {1}. Your Designation is {2}", empl.Fname, empl.Lname, empl.Desig); | |
} | |
} |
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
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, | |
ConcurrencyMode = ConcurrencyMode.Multiple)] | |
public class WCFDemo : IEmployee | |
{ | |
[OperationBehavior(Impersonation = ImpersonationOption.Required)] | |
public string PrintEmployee(Employee empl) | |
{ | |
return string.Format("Hello Employee {0} {1}. Your Designation is {2}", empl.Fname, empl.Lname, empl.Desig); | |
} |
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.Linq; | |
using System.Runtime.Serialization; | |
using System.ServiceModel; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace EmployeeService | |
{ |
OlderNewer