Skip to content

Instantly share code, notes, and snippets.

public class Athlete
{
[JsonProperty("id")]
public int ? Id {get;set;}
[JsonProperty("resource_state")]
public int ? ResourceState {get;set;}
[JsonProperty("profile_medium")]
public string ProfileMedium {get;set;}
public class Athlete
{
[JsonProperty("id")]
public int ? Id {get;set;}
[JsonProperty("resource_state")]
public int ? ResourceState {get;set;}
[JsonProperty("profile_medium")]
public string ProfileMedium {get;set;}
public class SSOMRepositoryBase
{
#region Constructor
public SSOMRepositoryBase(string contextUrl)
{
// Set the Context Url
this.ContextUrl = contextUrl;
}
public class CountryRepository : SSOMRepositoryBase<Country>, ICountryRepository
{
#region Constructor
public CountryRepository(string contextUrl) : base(contextUrl)
{
}
#endregion
public static Country ConvertToCountry(sp.SPListItem item)
{
  Country newCountry = new Country();
  try
  {
    if (item != null)
    {
      newCountry.Id = int.Parse(item[Resources.Fields_Id].ToString());
      newCountry.Title = item.Fields.ContainsField(Resources.Fields_Title1) && item[Resources.Fields_Title1] != null ? item[Resources.Fields_Title1].ToString() : string.Empty;
      newCountry.BusinessUnit = item.Fields.ContainsField(Resources.Fields_Title) && item[Resources.Fields_Title] != null ? item[Resources.Fields_Title].ToString() : string.Empty;
public interface ILogger
{
void LogDebug(string message);
void LogDebug(string message, string category);
void LogDebug(string message, Exception ex);
void LogDebug(string message, string category, Exception ex);
void LogInformation(string message);
void LogInformation(string message, string category);
void LogWarning(string message);
void LogWarning(string message, string category);
public partial class Logger: ILogger
{
#region Constructor
public Logger()
{
log4net.Config.XmlConfigurator.Configure();
this.Log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
}
<appender name="TracingAppenderFile" type="log4net.Appender.RollingFileAppender">
<file value=".\\\App_Data\\\Logs\" />
<datePattern value="yyyy-MM-dd'-TracingLogs.log'" />
<appendToFile value="true" />
<maximumFileSize value="256KB" />
<maxSizeRollBackups value="20" />
<rollingStyle value="Date" />
<staticLogFileName value="false" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
using log4net.Core;
using log4net.Layout.Pattern;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
<parameter>
<parameterName value="@Category" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{Category}" />
</layout>
</parameter>