Home Q&A

Login Form



Questions and answers
How To: Prevent Entity Framework Navigation Property from being exposed through WCF service.

Starting with Visual Studio 2010, when you generate a model from an existing database, the ADO.NET Entity Data Model Designer (Entity Designer) creates scalar properties on entity types that correspond to foreign key columns in the database.

By default, the Entity Designer also generates navigation properties on entity types that can be used to create and modify relationships.

The problem is that this auto generated navigation property are marked with DataMemberAttribute and thus, exposed to the WCF client.

In case you use LazyLoading feature of entity Framework, then data contract serializer will try to serialize WHOLE graph of the objects, resulting in huge amount of data to be transferred to the client.

If you disable LazyLoading, this will reduce the amount of data being transferred to the client. But in this case navigation properties will be still present on the client side, confusing it (If navigation property contains no data, client will not know if there is no data in the DB or property was not loaded by the WCF service).

Therefore, i think in some cases it is really good to exclude Entity Framework Navigation Properties from WCF service contract.

Doing so will allow you to continue to use LazyLoading (i like this) in your WCF service implementation, while clearing client-side object definitions.

There are several possible ways to achieve it. I found the following one to be just right work me

Read more...
 
HOWTO display animated gifs with blockUI plugin in IE7

Problem: when you use animated images in blockUI messages and bind it to the submit event, IE does show them not animated but static.

 

Solution:

1. First, make sure that animation is enabled in IE: Toos->Internat opetions->Advanced->Multimedia->Play animation in webpages.

2. Assign the id for the animated image. Example:

<div id="waitMessage" style="display:none;"> 
    <p><br /><img id="progress_image" style="vertical-align: middle" src="/<%=Html.Encode(siteroot) %>Images/busy.gif" /><span style="vertical-align: middle"> Just a moment...</span></p><br />
</div>

 

Read more...
 
HowTo enable CLR stored procedures, triggers and functions in SQL Server.

Execute this commands in SQL Server Management Studio to enable CLR stored procedures, triggers and functions in SQL Server:

exec sp_configure 'clr enabled', '1';

reconfigure;

 

 
How to to precompile MVC application including code and views.

To do so, you need to install the Visual Studio Web Deployment add-in (see http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en

Then in your MVC solution, right click on the MVC project and select "Add Web Deployment Project..."

 

Besides this add-in, you also can use aspnet_compiler utility. Running the command line utility using aspnet_compiler will do the job.

The command line is:

aspnet_compiler -v  /virtualDirName outputdirectoryName

 
How to solve PHPMAILER_RECIPIENTS_FAILED.

If you get this error message, then, most probably, one of your mail recipient's address belongs to one of your addon domain, but mail for this domains are managed outside.

To solve the issue you need to "tell" your provider that mail for particular addon domain is managed outside by specifying correct MX records.

Read more...
 
How to clear local DNS cache on Windows

To clear (flush)  local DNS cache on Windows use this command:

 

ipconfig /flushdns

 

 
Can not read and compose emails on iPhone and iPod with iOS 4.1

After upgrading to iOS 4.1 you may experience this simptoms:

1. Opening emai message you will see the message body empty.

2. Composing new email you will see no message body field.

 

Solving this situation is easy - just couple of touches of your iPhone/iPod screen:

Read more...
 
How to capture network traffic in Windows

Microsoft Network Monitor is what you need.

 

More details are here: http://support.microsoft.com/kb/148942

 

 
How to manually delete (uninstall) a Windows Service

Time to time (especially if you develop and test windows services) you need to delete (uninstall) Windows Service manually.

 

The fastest way to do it on Windows XP and above (Vista, Win7) is to run this command:

sc delete < service-name > 

 
How to enable OpenID for Joomla!

While the answer is extremely simple, time to time it takes too much time to figure it out what you need to get it done.

Here is a checklist of what you need to make it happen:

  • Joomla! version.  It should be Joomla! 1.5.20 Stable [ senu takaa ] 18-July-2010 18:00 GMT
  • PHP version. It should be PHP5, BUT not 5.3 OpenId PHP library included in Joomla! OpenID plugin is somehow incompatible with PHP 5.3
  • OpenID plugin should be enabled:

HowToEnableOpenID1

  • We found it usefull to change Name/username parameter value to "Name" in the mod_login parameters:

HowToEnableOpenID2

That's it! Go and try it.

 

P.S.

I have heard a rumors and read this discussion: http://groups.google.com/group/joomlabugsquad/browse_thread/thread/adeffbc94629e332 and i am going to be dissappointed. If Joomla! team will really exclude OpenId from the system in 1.6 release,  and this featur become unavailable for my sites, then it will be a good reason for me to jump to one of the alternative CMS.

P.P.S. Joomla! Bug Squad!!!! Please do not do this!!!!

 

 


cialis 40mg

Copyright © 2012 SmartSoftwareBits.com. All Rights Reserved.
 

Polls

What is your favourite .NET language?
 

Who's Online

We have 12 guests online