суббота, 28 ноября 2015 г.
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/
пятница, 27 ноября 2015 г.
EF Stored procedures
https://msdn.microsoft.com/en-us/data/ee712907#codefirst
https://msdn.microsoft.com/en-us/data/dn468673.aspx
https://msdn.microsoft.com/en-us/data/jj691402.aspx
http://www.codeproject.com/Articles/179481/Code-First-Stored-Procedures
https://codefirstfunctions.codeplex.com/
http://www.entityframeworktutorial.net/EntityFramework6/code-first-insert-update-delete-stored-procedure-mapping.aspx
http://www.c-sharpcorner.com/UploadFile/ff2f08/code-first-stored-procedure-entity-framework-6-0/
http://stackoverflow.com/questions/20901419/how-to-call-stored-procedure-in-entity-framework-6-code-first
среда, 25 ноября 2015 г.
Server Install
0. Install RDP
1. Aida
2. Windows Components IIS
3. MSSQL Express
4. Asp.Net WebInstaller
FTP
PowerShell
webMatrix
1. Aida
2. Windows Components IIS
3. MSSQL Express
4. Asp.Net WebInstaller
FTP
PowerShell
webMatrix
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.
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¶m2=2¶m3=3
{
Find Method(param1, param2) is Successfull
}
if Request = = param1=1¶m2=2
{
Find Method(param1, param2, param3) is Failure
}
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¶m2=2¶m3=3
{
Find Method(param1, param2) is Successfull
}
if Request = = param1=1¶m2=2
{
Find Method(param1, param2, param3) is Failure
}
четверг, 19 ноября 2015 г.
Convert c#
http://stackoverflow.com/questions/14860416/why-c-sharp-does-not-require-explicit-casting-for-convert-long-to-double
The language has some implicit conversion built into it.
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.
пятница, 13 ноября 2015 г.
понедельник, 9 ноября 2015 г.
суббота, 7 ноября 2015 г.
Assembly.Load()
https://msdn.microsoft.com/ru-ru/library/system.reflection.assembly.load(v=vs.110).aspx
http://www.codeproject.com/Articles/597398/Loading-Assemblies-using-Assemb
http://stackoverflow.com/questions/465488/can-i-load-a-net-assembly-at-runtime-and-instantiate-a-type-knowing-only-the-na
http://stackoverflow.com/questions/1137781/c-sharp-correct-way-to-load-assembly-find-class-and-call-run-method
http://professorweb.ru/my/csharp/assembly/level2/2_7.php
Types Load:
http://stackoverflow.com/questions/11430654/is-it-possible-to-use-type-gettype-with-a-dynamically-loaded-assembly
https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname.aspx
http://www.codeproject.com/Articles/32828/Using-Reflection-to-load-unreferenced-assemblies-a
пятница, 6 ноября 2015 г.
PowerShell Delete Files
http://superuser.com/questions/741945/delete-all-files-from-a-folder-and-its-sub-folders
http://www.networknet.nl/apps/wp/published/powershell-delete-files-older-than-x-days
http://stackoverflow.com/questions/17829785/delete-files-older-than-15-days-using-powershell
http://www.tomsitpro.com/articles/powershell-file-management,2-812.html
http://www.computerperformance.co.uk/powershell/powershell_remove_item.htm
http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/22/the-best-way-to-use-powershell-to-delete-folders.aspx
вторник, 3 ноября 2015 г.
Web API Thoughts 1 of 3 - Data Streaming
http://www.codeproject.com/Articles/838274/Web-API-Thoughts-of-Data-Streaming
http://stackoverflow.com/questions/16168683/webapi-streamcontent-vs-pushstreamcontent
http://stackoverflow.com/questions/20031234/what-is-different-with-pushstreamcontent-between-web-api-web-api-2
http://stackoverflow.com/questions/23884182/how-to-get-byte-array-properly-from-an-web-api-method-in-c
http://dave-mills.net/2014/04/streaming-attachments-with-pushstreamcontent/
http://www.thomaslevesque.com/tag/pushstreamcontent/
Подписаться на:
Сообщения (Atom)