Skip to content

Instantly share code, notes, and snippets.

💭
checking react these days!

rahul sahay rahulsahay19

💭
checking react these days!
Block or report user

Report or block rahulsahay19

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sample
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;
}
View sample class
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]
View Service Contract
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
View Service Implementation
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);
}
}
View Service Behaviour
[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);
}
@rahulsahay19
rahulsahay19 / Sample WCF Implementation
Last active Aug 29, 2015
Sample WCF Implementation
View Sample WCF Implementation
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
{
You can’t perform that action at this time.