اشتراک‌ها
Paper Cut یک ایمیل سرور دسکتاپ
If you ever send emails from an application or web site during development, you're familiar with the fear of an email being released into the wild. Are you positive none of the 'test' emails are addressed to colleagues or worse, customers? Of course, you can set up and maintain a test email server for development -- but that's a chore. Plus, the delay when you are waiting to view new test emails can radically slow your development cycle 
Paper Cut یک ایمیل سرور دسکتاپ
اشتراک‌ها
ASP.NET Core .NET 5 Preview 8 منتشر شد

Here’s what’s new in this release:

  • Azure Active Directory authentication with Microsoft.Identity.Web
  • CSS isolation for Blazor components
  • Lazy loading in Blazor WebAssembly
  • Updated Blazor WebAssembly globalization support
  • New InputRadio Blazor component
  • Set UI focus in Blazor apps
  • Influencing the HTML head in Blazor apps
  • IAsyncDisposable for Blazor components
  • Control Blazor component instantiation
  • Protected browser storage
  • Model binding and validation with C# 9 record types
  • Improvements to DynamicRouteValueTransformer 
  • Auto refresh with dotnet watch 
  • Console Logger Formatter
  • JSON Console Logger 
ASP.NET Core .NET 5 Preview 8 منتشر شد
اشتراک‌ها
ReSharper 2023.2 منتشر شد

ReSharper 2023.2: More C#, C++ 20, And C++ 23 Features, the Ability To Create And Navigate Through Unit Tests, Predictive Debugger Mode, And More 

ReSharper 2023.2 منتشر شد
اشتراک‌ها
روش های مدرن برای ثبت خطا در سی شارپ

Logging is a big part of software development for many years now. One can argue that a logging mechanism is a must-have part of any application or library. I would agree with that statement. Logging has a crucial part to play in a scenario where you can’t use interactive debugging (that is, attaching a debugger like Visual Studio). It allows us to investigate errors after the problem already happened. In some cases, like Production Debugging, logs might be the only information you have. 

روش های مدرن برای ثبت خطا در سی شارپ
اشتراک‌ها
کتاب Getting the Most from LINQPad Succinctly

LINQPad is a powerful testing tool for all .NET developers that can help them deliver solutions in less time. In Getting the Most from LINQPad Succinctly, returning Succinctly series author José Roberto Olivas Mendoza lays out different ways to extend the functionality built into LINQPad. In this ebook, you’ll learn how to use LINQPad to query Entity Framework models in Visual Studio, how to work with the LINQPad command-line utility, how to write your own extensions and visualizers, and how to write custom data context drivers.

TABLE OF CONTENTS
  • A Quick Tour of LINQPad

  • LINQPad and Entity Framework

  • LINQPad Scripting

  • LINQPad Extensibility

  • Custom Data Context Drivers

کتاب Getting the Most from LINQPad Succinctly
مطالب
بررسی صحت پشتیبان‌های تهیه شده در SQL Server

اولین و اساسی‌ترین قدم در نگهداری یک سیستم مبتنی بر داده، تهیه پشتیبان‌های منظم و همچنین قابل اطمینان می‌باشد.
دستور T-SQL زیر بدون ری‌استور کردن یک فایل بک آپ اس کیوال سرور، سعی در تعیین اعتبار آن می‌کند:
RESTORE VERIFYONLY
FROM DISK = 'C:\SQL_Backup\Test1'
WITH FILE = 1,
LOADHISTORY
این دستور وضعیت کامل بودن پشتیبان و همچنین قابل خواندن بودن اطلاعات آن‌را برسی می‌کند و در صورت سالم بودن بک آپ، پیغام زیر را نمایش خواهد داد:

The backup set on file 1 is valid.
عموما عملیات تهیه پشتیبان در یک مکان مشخص در سرور صورت می‌گیرد (خصوصا اگر یک job مختص به آن تعریف شده باشد که این‌کار را به صورت خودکار انجام دهد). بنابراین می‌توان عملیات اعتبار سنجی فوق را مکانیزه کرد. اسکریپت زیر مسیر آخرین بک آپ‌های گرفته شده در سرور را بر می‌گرداند:
SELECT DISTINCT physical_device_name
FROM msdb.dbo.backupmediafamily
ORDER BY
physical_device_name
اکنون می‌توان مسیر‌های فوق را در یک cursor جهت بررسی صحت تک تک موارد استفاده نمود:

DECLARE @path NVARCHAR(1000),
@msg NVARCHAR(MAX),
@NewLine CHAR(2),
@sql NVARCHAR(2000)

SET @NewLine = CHAR(13) + CHAR(10)
SET @msg = ''

DECLARE DATABASES_CURSOR CURSOR
FOR
SELECT DISTINCT physical_device_name
FROM msdb.dbo.backupmediafamily
ORDER BY
physical_device_name

OPEN DATABASES_CURSOR

FETCH NEXT FROM DATABASES_CURSOR INTO @path

WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'Verifying: ' + @path
SET @sql = 'RESTORE VERIFYONLY FROM DISK = ''' + @path
+ ''' WITH FILE = 1, LOADHISTORY'

EXEC sp_executesql @sql
IF @@ERROR <> 0
BEGIN
SET @msg = @msg + 'Failed to verify: ' + @path + @NewLine
END

FETCH NEXT FROM DATABASES_CURSOR INTO @path
END

CLOSE DATABASES_CURSOR
DEALLOCATE DATABASES_CURSOR

IF @msg <> ''
BEGIN
PRINT @msg
-- send email
EXECUTE msdb.dbo.sp_send_dbmail
@recipients = 'nasiri@site.net', -- Change This
@copy_recipients = 'Administrator@site.net', -- Change This
@Subject = 'backup verification info.',
@Body = @msg
,@importance = 'High'

END

اسکریپت فوق بر روی تمامی مسیرهای ثبت شده موجود که در آن‌ها پیشتر پشتیبان تهیه شده است، دستور RESTORE VERIFYONLY را اجرا می‌کند و در آخر اگر پیغامی حاصل شد، یعنی مشکلی پدید آمده و ایمیلی را به اشخاص مورد نظر ارسال می‌کند.
می‌توان بر روی این اسکریپت یک job تهیه کرد که هر روز پس از تهیه بک آپ خودکار، کار بررسی صحت عملیات را نیز انجام دهد.

اشتراک‌ها
لیستی از C# Source Generators

C# Source Generators

A list of C# Source Generators (not necessarily awesome), because I haven't found a good list yet.

C# Source Generators is a Roslyn compiler feature introduced in C#9/.NET 5. It lets C# developers inspect user code and generate new C# source files that can be added to a compilation. 

لیستی از C# Source Generators
اشتراک‌ها
Ruby On Rails یکی از پر مخاطب ترین زبان های برنامه نویسی در سال 2016

When Ruby on Rails, a web application framework written in the Ruby programming language, was first released as open source back in July 2004, it stumbled to rise in the rankings as one of the top programming languages. But in 2006, Apple announced that it would be shipping Ruby on Rails with their Mac OS X v10.5 “Leopard” and Ruby soon became known and used by many. So much so, that the TIOBE index, a measure of the popularity of programming languages, named Ruby the “Programming Language of 2006.” However, due to some scalability issues and the release of other exciting new tools, such as Node.js and AngularJS, Ruby started to lose its popularity and by 2008 it seemed as if it was on its way out. 

Ruby On Rails یکی از پر مخاطب ترین زبان های برنامه نویسی در سال 2016