суббота, 28 ноября 2015 г.

double

EntityFramework, Web Api, MVC Async Operation

http://stackoverflow.com/questions/29168188/asp-net-web-api-2-async-action-methods-with-task-run-performance

https://msdn.microsoft.com/en-us/data/jj819165.aspx

https://msdn.microsoft.com/ru-ru/library/hh191443.aspx

http://stackoverflow.com/questions/25204336/why-dbsettentity-doesnt-implement-enumerableasync

http://stackoverflow.com/questions/21631774/entityframework-dbcontext-and-using-async

http://www.asp.net/mvc/overview/performance/using-asynchronous-methods-in-aspnet-mvc-4

http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html

https://www.simple-talk.com/dotnet/.net-framework/the-.net-4.5-asyncawait-feature-in-promise-and-practice/

http://blog.tonysneed.com/2013/03/22/async-services-asp-net-web-api-entity-framework-6/

http://www.c-sharpcorner.com/UploadFile/2b481f/create-asynchronous-action-method-in-web-api/

среда, 25 ноября 2015 г.

Server Install

0. Install RDP
1. Aida
2. Windows Components IIS
3. MSSQL Express
4. Asp.Net WebInstaller
FTP
PowerShell
webMatrix


Порты для UDP

EntityFramework BulkInsert

https://efbulkinsert.codeplex.com/

https://www.nuget.org/packages/EntityFramework.BulkInsert-ef6/

http://stackoverflow.com/questions/5940225/fastest-way-of-inserting-in-entity-framework

http://weblog.west-wind.com/posts/2013/Dec/22/Entity-Framework-and-slow-bulk-INSERTs

https://github.com/MikaelEliasson/EntityFramework.Utilities

http://www.djamseed.com/2015/08/31/improving-bulk-insert-performance-with-entity-framework/

http://www.infoq.com/news/2014/12/EF-Bulk-Operations

http://www.seguetech.com/blog/2015/01/26/performing-bulk-updates-entity-framework-6.1%2B

https://www.credera.com/blog/technology-insights/microsoft-solutions/entity-framework-batch-operations-using-ef-utilities/

https://www.credera.com/blog/technology-insights/microsoft-solutions/entity-framework-batch-operations-using-ef-utilities/

EntityFramework AutoDetectChanges

https://msdn.microsoft.com/en-us/data/jj556205.aspx

using (var context = new BloggingContext()) 
{ 
    try 
    { 
        context.Configuration.AutoDetectChangesEnabled = false; 
 
        // Make many calls in a loop 
        foreach (var blog in aLotOfBlogs) 
        { 
            context.Blogs.Add(blog); 
        } 
    } 
    finally 
    { 
        context.Configuration.AutoDetectChangesEnabled = true; 
    } 
}
Don’t forget to re-enable detection of changes after the loop —
 We've used a try/finally to ensure it is always re-enabled even if code in the loop throws an exception.
An alternative to disabling and re-enabling is to leave automatic detection of changes turned off
 at all times and either call context.ChangeTracker.DetectChanges explicitly 
or use change tracking proxies diligently.
 Both of these options are advanced and can easily introduce subtle bugs into your application
 so use them with care.

http://stackoverflow.com/questions/16863382/dbcontext-autodetectchangesenabled-set-to-false-detecting-changes

http://blog.staticvoid.co.nz/2012/5/7/entityframework_performance_and_autodetectchanges

http://blog.oneunicorn.com/category/entity-framework/change-tracking/

http://blog.oneunicorn.com/2012/03/10/secrets-of-detectchanges-part-1-what-does-detectchanges-do/

http://blog.oneunicorn.com/2012/03/12/secrets-of-detectchanges-part-3-switching-off-automatic-detectchanges/

SqlBulkCopy

http://habrahabr.ru/post/251397/

понедельник, 23 ноября 2015 г.

WebApi Mapping

1. Request find success Method in Controller if

if( Request.Parameters  >=  Controller.Method.Parameter)
{
      Find Method to ProcessRequest is Succesfull
}
else
      Find Method to ProcessRequest is Failure

for example

if Request = = param1=1&param2=2&param3=3
{
     Find Method(param1, param2) is Successfull
}

if Request  = = param1=1&param2=2
{
     Find Method(param1, param2, param3) is Failure
}

четверг, 19 ноября 2015 г.

Convert c#

The following table is from the documentation, which is why you are allowed to assign the value without an explicit cast or conversion:
From        To
===============================================================================
sbyte       short , int, long, float, double, or decimal
byte        short , ushort, int, uint, long, ulong, float, double, or decimal
short       int , long, float, double, or decimal
ushort      int , uint, long, ulong, float, double, or decimal
int         long , float, double, or decimal
uint        long , ulong, float, double, or decimal
long        float , double, or decimal
char        ushort , int, uint, long, ulong, float, double, or decimal
float       double
ulong       float , double, or decimal
And in the documentation it states (emphasis mine):
Precision but not magnitude might be lost in the conversions from int, uint, long, or ulong to float and from long or ulong to double.