Thursday, December 26, 2013

LINQ to Entities CLR Methods Mapping

It's very useful to have this in mind when you write lambda expressions or use LINQ to Entities

For example, you can't compare GUID to string using ToString() Method in the lambda expression as ToString() Doesn't have a mapping, but you can use New GUID 

http://msdn.microsoft.com/en-us/library/bb738681(v=vs.110).aspx

Thursday, December 5, 2013

Useful Entity Framework Tutorials

It's rare to find a complete tutorials' series like W3Schools but this site make a great series for Entity Framework http://www.entityframeworktutorial.net/

Tuesday, October 8, 2013

Post to twitter programatically with 3 lines of Code!

  1. Create a new web application
  2. using Nuget manager, download/install Tweetsharp
  3. Create a twitter application by visiting https://dev.twitter.com/apps/new
  4. Go to your twitter app settings, and make sure it's a read/write app
  5. Go to "Reset Keys" tab and reset keys, so the permission of read/write works with the new keys
  6. Generate Access Token and the first tab in your twitter settings
  7. Write the following Code, *Replace Dashes with your app keys, from the previous steps
======================================
using TweetSharp;
        //Store Keys
        string consumerKey = "-------";
        string consumerSecret = "-------";
        string accessToken = "-------";
        string accessTokenSecret = "-------";
        //Authenticate with twitter as your app.
        var service = new TwitterService(consumerKey, consumerSecret);
        service.AuthenticateWith(accessToken, accessTokenSecret);
        //Post Tweet
        var status = service.SendTweet(new SendTweetOptions { Status = "My Second #Tweet from Code :D" });
======================================
-- You can use the status variable to know the id of you posted status etc.

Thursday, April 11, 2013

How to make my desktop less destractive

I Simply use virtual desktops program, which give me many desktops, if you use linux, you may be familiar with this technique .. Instead of having one desktop full of programs' windows you can have many desktops each one have a set of programs, so you can switch context and environment easily

for example, browser with social networks and E-mail clients etc. on one desktop
and the other desktop contains other browsers to test my web application and my media player

Application Here http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx

Sunday, March 31, 2013

Less for Dot Net - Asp.net

Introduction

Just hit an interesting utility, LESS Compiler for .net (asp.net)
So you can leverage the power of less (Dynamic CSS) in your .net web applications

Usage

Just add the following to the Web.config
<add type="dotless.Core.LessCssHttpHandler,dotless.Core" validate="false" path="*.LESS" verb="*" />
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler,dotless.Core" />
 
So, now you added a handler for .less files
 
Then configure it
<dotless minifyCss="false"
 cache="true" />   

*You can also use it from the code
Less.Parse("div { width: 1 + 1 }");
which will produce 
div {
  width: 2;
}
 

More Here
http://www.dotlesscss.org/

Wednesday, March 27, 2013

Why to use Sharepoint - Sharepoint Features Advantages and Disadvantages

Introduction

Actually this is just personal opinion about sharepoint, and I'll update it periodically with any new discoveries

I started to use sharepoint some months ago ..
So Not all things mentioned here are professional opinion, So feel free to discuss with me your opinions .

Sharepoint Advantages

  • Extreme Integration with other Microsoft products, like Lync, Outlook and Office suite etc.
     
    So you can integrate sharepoint site easily with outlook in minutes and login with windows accounts, using active directory of course .
    We can discuss integration capabilities later, if you want ...
  • Very useful for intranets due to its massive integration capabilities 
  • Many out of the box features like polls, discussions etc.

Sharepoint Disadvantages 

  • Very Heavy (Not very good in performance)
  • Requires Massive Hardware architecture (Server Farm)
  • Doesn't play well with all browsers, but it's improving with new versions

Share you ideas and opinions with me ...

Monday, March 25, 2013

About

Hi,
This is my Blog, it will be Technical, Personal and News Blog ..
I'll post about anything i find interesting, if you have same interests follow me