Search This Blog

Monday, July 1, 2013

Entity frameworks notes

if you get such error while serialize your entity ".......System.Data.Entity.DynamicProxies is not expected."
after creating your entity context (generated class derived from DbContext) the next line:

 base.Configuration.ProxyCreationEnabled = false;

to solve the error of
DataContractJsonSerializer  "reference tracking is disabled" 
i remove some of my association i created to avoid back reference

Loading Related Entities -  http://msdn.microsoft.com/en-us/data/jj574232.aspx

links for EE framework
http://blogs.msdn.com/b/adonet/archive/2011/01/31/using-dbcontext-in-ef-feature-ctp5-part-6-loading-related-entities.aspx


To get the SQL query that generated by db entity use:
var sql = ((System.Data.Entity.Infrastructure.DbQuery<tbl_artists>)query).ToString();
if its object:
var sql = ((System.Data.Objects.ObjectQuery)result).ToTraceString();

Basic LINQ Query Operations (C#)



Saturday, June 8, 2013

IIS Express - access from android while debugging

i am working on end to end project , need to build the android UI and the web services.
while building the webservice via .NET i wanted to test them via my device connected to my usb.

i noticed i failed to access the IISEXpress ,only localhost works.
i couldn't use localhost  on my url , i get an error.
one of the solution is to use my ip (in the local domain 10.0.0.5),
but i get access error HTTP/1.1 400 Bad Request 
i follow this link
http://stackoverflow.com/questions/5433786/configure-iis-express-for-external-access-to-vs2010-project/5438322#5438322

and this
http://stackoverflow.com/questions/7877523/how-to-allow-iisexpress-to-listen-internet

and i decided to change the next file  (win 7)
%userprofile%\documents\iisexpress\config\applicationhost.config

i change the next line - under my project (replace localhost with 10.0.0.5)
 <binding protocol="https" bindingInformation="*:44300:10.0.0.5" />

and my android managed to consume the service 

enjoy 
yaniv tzanany

Passing multiple POST parameters to Web API Controller Methods

Passing multiple POST parameters to Web API Controller Methods


http://www.west-wind.com/weblog/posts/2012/May/08/Passing-multiple-POST-parameters-to-Web-API-Controller-Methods

Wednesday, June 5, 2013

Microsoft Visual C++ Tips and Tricks

Microsoft Visual C++ Tips and Tricks:

 "0xCDCDCDCD Allocated in heap, but not initialized
0xDDDDDDDD Released heap memory.
0xFDFDFDFD "NoMansLand" fences automatically placed at boundary of heap memory. Should never be overwritten. If you do overwrite one, you're probably walking off the end of an array.
0xCCCCCCCC Allocated on stack, but not initialized"

Develop For Google Glass?

Want To Develop For Google Glass? Watch These Videos | WebProNews: