Skip to content

Instantly share code, notes, and snippets.

View oguzhankircali's full-sized avatar
:octocat:
Creating a product

Oğuzhan Kırçalı oguzhankircali

:octocat:
Creating a product
View GitHub Profile
@oguzhankircali
oguzhankircali / Precision.cs
Created October 17, 2018 10:53
Set Precision of Decimal Property on DB Context
modelBuilder.Entity<PolicyInsuredFactor>().Property(e => e.Multiplier).HasPrecision(30, 16);
public class CommonResponse
{
public bool IsSuccess { get; set; }
public string Message { get; set; }
public object Object { get; set; }
public CommonResponse()
{
}
--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 = ''
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
public static string VersionInfo
{
get
{
if (HttpContext.Current.Application["VersionInfo"] == null)
{
HttpContext.Current.Application["VersionInfo"] = Assembly.GetExecutingAssembly().GetLinkerTime().ToString();
}
public static string HostIPAddress
{
get
{
if (HttpContext.Current.Application["HostIPAddress"] == null)
{
try
{
IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName());
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);
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))
public static string GetDescription(this Enum value)
{
string description = string.Empty;
if (value != null)
{
description = value.ToString();
FieldInfo fieldInfo = value.GetType().GetField(description);
DescriptionAttribute[] attributes = (DescriptionAttribute[])fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
if (attributes.Length > 0)
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.0.226/pdf.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.0.226/pdf_viewer.js"></script>
</head>
<body>
<a class="btn btn-default" href="/pdf/viewer?file=/common/file/" target="_blank"><i class="fa fa-file-pdf-o"></i> PDF Görüntüle</a>
</body>
</html>