This file contains hidden or 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 static List<KeyValuePair<TEnum, string>> ToEnumDescriptionsList<TEnum>() | |
| { | |
| return ToEnumDescriptionsList<TEnum>(default(TEnum)); | |
| } | |
| public static List<KeyValuePair<TEnum, string>> ToEnumDescriptionsList<TEnum>(this TEnum value) | |
| { | |
| return Enum | |
| .GetValues(typeof(TEnum)) |
This file contains hidden or 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 static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = null) | |
| { | |
| var filePath = assembly.Location; | |
| const int c_PeHeaderOffset = 60; | |
| const int c_LinkerTimestampOffset = 8; | |
| var buffer = new byte[2048]; | |
| using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) | |
| stream.Read(buffer, 0, 2048); |
This file contains hidden or 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 static string HostIPAddress | |
| { | |
| get | |
| { | |
| if (HttpContext.Current.Application["HostIPAddress"] == null) | |
| { | |
| try | |
| { | |
| IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName()); |
This file contains hidden or 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 static string VersionInfo | |
| { | |
| get | |
| { | |
| if (HttpContext.Current.Application["VersionInfo"] == null) | |
| { | |
| HttpContext.Current.Application["VersionInfo"] = Assembly.GetExecutingAssembly().GetLinkerTime().ToString(); | |
| } |
This file contains hidden or 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
| declare @Alan1 int | |
| declare @Alan2 nvarchar(100) | |
| declare cur cursor for | |
| select Alan1,Alan2 from @t | |
| open cur | |
| fetch next from cur into @Alan1,@Alan2 |
This file contains hidden or 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
| --search in all cells | |
| declare @SearchStr nvarchar(100) | |
| set @SearchStr='ECZACILIK FAKÜLTESİ B' | |
| declare @Results TABLE (ColumnName nvarchar(370), ColumnValue nvarchar(3630)) | |
| SET NOCOUNT ON | |
| DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) | |
| SET @TableName = '' |
This file contains hidden or 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 CommonResponse | |
| { | |
| public bool IsSuccess { get; set; } | |
| public string Message { get; set; } | |
| public object Object { get; set; } | |
| public CommonResponse() | |
| { | |
| } |
This file contains hidden or 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
| modelBuilder.Entity<PolicyInsuredFactor>().Property(e => e.Multiplier).HasPrecision(30, 16); |
This file contains hidden or 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
| //TR: Bu metodu çağıran metotlarda rollback olduğundan, loglamayı etkilemesin diye RequiresNew attribute'u ekleniyor. | |
| //Bu sayede metodun bitmesini beklemeden commit etmiş oluyor | |
| //EN: Parent method of this have rollback features, but i want to log it, | |
| //because of this i added TransactionScopeOption.RequiresNew to unit of work | |
| var unitOfWorkManager = IocManager.Instance.Resolve<IUnitOfWorkManager>(); | |
| using (var unitOfWork = unitOfWorkManager.Begin(System.Transactions.TransactionScopeOption.RequiresNew)) | |
| { | |
| _serviceLogManager.InsertOrUpdateAndGetId(this.ServiceLogEntity); |
This file contains hidden or 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.ServiceModel; | |
| using System.ServiceModel.Description; | |
| using System.ServiceModel.Dispatcher; | |
| using System.Linq; | |
| using SoapLogging.Database; | |
| namespace SoapLogging.Common | |
| { | |
| public class SoapBehavior : IEndpointBehavior, IClientMessageInspector |