RSS

Monthly Archives: September 2012

Move Entity Types to Another Project in EF Code Generation

EF Code Generation is cool and all. But for some, we want separation of concern, particularly in this case, the types that generator generates.

This is how my EDMX looks like after adding ADO.Net Entity Data Model.

What we are going to do is to move Model.tt to another project.

Create the project. And move the file to the new project.
In Visual Studio 2012, I can’t drag and drop the file, so I have to browse to project’s folder and copy it manually to another project’s folder. Note that only Model.tt needs to be moved.

After copying Model.tt file, you will see this in Visual Studio’s Solution Explorer after clicking Refresh and Show All Files buttons located on top of the Solution Explorer.

Right click on the Model.tt in the new project to include the file in the project. If you receive errors, that’s fine, we will fix it.
Delete Model.tt file in the old project.
Open Model.tt file in Visual Studio and change the input file for the template file to point to EDMX file located on the project (shown below on line 5). Save the file.

At this point, you will see the template file has generated all entity types in the new project you just created.

Since the entity types have moved, the namespace has also changed. Thus, we will need to change namespace of the context template so that the compiler will find the entity types.

Open up property browser window of Model.Context.tt template file in the old project.
Change Custom Tool Namespace property to namespace that the Model.tt is located. You can open one of the files generated by Model.tt to see the namespace.

In the old project, add reference to the new project.

Build the solution to make sure everything works.

 
2 Comments

Posted by on September 8, 2012 in General

 

Tags: ,

New Way to Promote Daily Deals

I keep getting emails from friends about Starbucks or Chick-fil-A deals. To some people, it’s useful, for me it’s annoying. I know how to find deals on the big I and if I need one, I will go find it. Regardless, deals hunter / daily deals company can leverage this to help them promote their deals and compensating the promoter with little something.

The Idea

This idea is actually an old idea and has been used by online retailers long time ago. It’s called Affiliate programs, some call it Associate, or Rewards program. The program allows you to sign up for an affiliate account and provide you many ways to promote their products (link, email, picture, etc). You will then get rewarded based on your performance.

The programs can also be implemented by any daily deals companies.

Benefit

  • Leverage all users to help generate sales.
  • Reward loyalty and high performance users.
  • Mouth-to-mouth advertising, very effective.

Why is it possible?

Many reasons. First, not everybody knows how and where to find good deals on the Internet, some are just not very tech savvy. Some don’t have time to hunt for better deals. Some don’t care.

Secondly, there are always those annoying friends who like to spam others with deals. This will encourage them even more. On the other side though, these people are useful for companies.

Plus, your friends probably know what you need / want / like better than any deals hunter sites. So, rather than you browsing around many deals hunter sites, your friend can just send you whatever you need.

Will it work?

 
Leave a comment

Posted by on September 8, 2012 in General

 

Tags:

EF 5.x DbContext Generator Missing Using Directive

Apparently, the new EF 5.x DbContext Generator template has a bug where the generated code doesn’t include the necessary Using directive, namely System and System.Collections.Generic. At least, this happens to me.

To fix it, add the following code

<#=codeStringGenerator.UsingDirectives(inHeader: false)#>

The code can be seen on line 26.

 
Leave a comment

Posted by on September 8, 2012 in General

 

Tags: ,

GPS with Built-In Cars Detection

Idea

GPS that has capability of showing cars around you. The device will also alert when a car in high speed is approaching you or the other way around.

Benefit

  • Avoid car accident involving cars in your blind spot.
  • Aware of cars that run over red light.

How?

Equipped a car with car detectors to detect and identify cars around you, along with their size and speed. Car detection can be achieved with many techniques, such as: camera, thermal heat imager, wave ultra sound, etc. The techniques should be combined to get more accurate result.

Once all the cars around you have been mapped in to a device (GPS), it’s just the matter of detecting collision between each object.

Why is it possible?

Camera technology has become more advanced every day, smaller and higher image quality. Coupled with sophisticated image processing and recognition software. we can easily identify cars (or any object) around us.

In addition to that, thermal heat images is also available widely out there. One example is from Rob Hopeless with its iPhone / Android Thermal Images.

Soon, we will have a GPS like the one in Batmobile.

Will it work?

 
Leave a comment

Posted by on September 7, 2012 in General

 

Tags:

Host WCF in IIS with Windows 8

For some people, like me, running the real IIS (not IIS Express) is preferably. When you host WCF in IIS under Windows 8 platform, like me, you can run into several problems. This is mine:

In Windows 8, I can’t use ServiceModel Registration Tool and it points me “Turn Windows feature on or off” which is under Control Panel setting.

Once in Windows Features window, make sure the highlighted item is check to be installed.

 
Leave a comment

Posted by on September 6, 2012 in General

 

Tags: , ,

One Shopping Cart, an Idea for Google Chrome

Idea

Equipped Google Chrome with shopping cart that will work for all eCommerce sites.

Benefit

  • One shopping cart to see all your orders and review them.
  • One-time, no-hassle, easy check out for all eCommerce sites.
  • No need to store personal information in every sites.
  • No need to type in your credit card / personal information in all sites.
  • Link shopping cart with any account, be it Google Check Out, Visa, or anything else.
  • When signed in Google Chrome, the shopping cart can be accessed cross-device.

Why is it possible?

Google Chrome can be extended to provide shopping cart API that every eCommerce site can talk to. This shopping cart API will allow eCommerce site to add, update and delete item in the cart. However, each eCommerce site is limited to only read the information the site put in shopping cart API. This will prevent each site to know what customer has ordered from other sites. The concept is almost like how cookies in browsers work.

Cross-device, or Cloud Shopping Cart, can be achieved by storing shopping cart information in Google cloud storage. This allows customers to shop from their phone, tablet, and office pc’s browser, then checkout from home pc.

Will it work?

 
Leave a comment

Posted by on September 4, 2012 in General

 

Tags:

 
%d bloggers like this: