How to extend and use EFMVC (codeplex.com)

I was looking for ways to extend and use EFMVC and the best way to learn is to just jump in!  I wanted to integrate the new “Simple Providers” with Entity Framework 5 in EFMVC and so I started looking into how to do that, which required me to learn how to extend EFMVC and how it is put together.  Here are the 6 steps to adding new functionality to EFMVC.

NOTE:  This is a work in progress. Please add your comments below so we can improve this.

 

Adding New Functionality

– new model, new db table…etc –

 

1       Add New Model

In EFMVC.Models project under the Entities folder, add a new class

  • Namespace must be namespace EFMVC.Model
  • Add DbSet for new model to inherited DbContext class
    • public DbSet<[New Model]> [New Model]s { get; set; }

 

2       Update SQL Server database from Model

In the PM console:

  • Add-Migration [*NAME OF UPDATE*] -ProjectName EFMVC.Data -StartUpProjectName EFMVC.Web -Verbose
  • Update-Database -ProjectName EFMVC.Data -StartUpProjectName EFMVC.Web -Verbose

3       Add Repository

In EFMVC.Data project under the Repositories folder, add a new class

  • Create two classes, one class from one interface
  • public class [New Model From Step 1]Repository : RepositoryBase<[New Model From Step 1]>, I[New Model From Step 1]Repository

public interface I[New Model From Step 1]Repository : IRepository<[New Model From Step 1]>

 

4       Create Configuration

In EFMVC.Data project under the Configurations folder, add a new class

  • public class [New Model From Step 1]Configuration : EntityTypeConfiguration<[New Model From Step 1]>
  • Register new configuration
    • In EFMVC.Data in EFMVCDataContex.cs under the OnModelCreating() function
      • modelBuilder.Configurations.Add(new [New Configuration From Step 4] ());

 

 

5       Create Command(s) for new model

In EFMVC.Domain project under the Commands folder, add new class(es)

  • Create a new folder with the name [New Model From Step 1]
  • Create a new file (class) in folder of type ICommand
    • Ex: CreateOrUpdate[New Model From Step 1]Command
      • Inherit from ICommand: public class CreateOrUpdateExpenseCommand : ICommand

 

6       Create Handler for new model

In EFMVC.Domain project under the Handlers folder, add new class(es)

  • Create a new folder with the name [New Model From Step 1]
  • Create a new file (class) in folder of type ICommand
    • Ex:    public class CreateOrUpdate[New Model From Step 1]Handler : ICommandHandler<CreateOrUpdate[New Model From Step 1]Command>
    • Create Constuctor (IoC) with appropriate repositories
      • Ex:  public CreateOrUpdateExpenseHandler(I[New Model From Step 1]Repository newRepository, IUnitOfWork unitOfWork)
  • Create function in new class
    • Ex:  public ICommandResult Execute([New Command From Step 5] command)

 

 

 

 

Next steps: Look into Universal Providers (to replace Simple Provider?)

Posted in asp.net, coding

Using LinkedIn oAuth2 API in ASP.NET

Having spent the better part of Saturday figuring out how to create a new post in my LinkedIn group via ASP.NET, I thought I’d share what I did to save others the trouble.

Issue 1:  POST-ing a new group post, but how do I get the post ID?

Code Snippet
  1. string postId = string.Empty;
  2. string groupPostURL = string.Format(“https://api.linkedin.com/v1/groups/{0}/posts”, groupId);
  3. StringBuilder url = newStringBuilder();
  4. url.Append(groupPostURL);
  5. url.Append(“?oauth2_access_token=” + GetAccessToken() );
  6. JsonServiceClient.HttpWebRequestFilter = x =>
  7.             x.Headers.Add(“Content-Type”, “application/json”);
  8. JsonServiceClient.HttpWebRequestFilter = x =>
  9.             x.Headers.Add(“x-li-format”, “json”);
  10. var client = newJsonServiceClient(“https://api.linkedin.com”);
  11. string newUrl = string.Format(“/v1/groups/{0}/posts”, groupId) + “?oauth2_access_token=” + GetAccessToken();
  12. //string responseJson = client.Post<string>(newUrl, groupPostContent);
  13. HttpWebResponse webResponse = client.Post<HttpWebResponse>(url.ToString(), json);
  14. if (webResponse.StatusCode == HttpStatusCode.Created)
  15. {
  16.     string location = webResponse.Headers[“Location”];
  17.     if (location != null)
  18.     {
  19.         int lastIndex = location.LastIndexOf(‘/’);
  20.         if (lastIndex > 0)
  21.         {
  22.             lastIndex++;
  23.             postId = location.Substring(lastIndex, (location.Length – lastIndex));
  24.         }
  25.     }
  26. }
  27. return postId;

It turns out the newly created LinkedIn Post ID is returned in the header under the “Location” field. However, RestSharp does not give me access to the Location header (even when turning off FollowRedirects) so I used ServiceStack’s JSON client and returning an HttpWebResponse object. Once I have that, I parse the Location header field to get the Post ID.

Issue 2: How to post a job to my LinkedIn Group?

You need to do this in two steps. First step is explained above and once you have the Post ID you go onto “flag” this new post as a job.

Code Snippet
  1. string linkedInURL = string.Format(“https://api.linkedin.com/v1/posts/{0}/category/code?oauth2_access_token={1}”, postId, GetAccessToken());
  2. RestClient rc = newRestClient();
  3. RestRequest request = newRestRequest(linkedInURL, Method.PUT);
  4. request.AddHeader(“Content-Type”, “application/xml”);
  5. request.AddHeader(“x-li-format”, “xml”);
  6. request.RequestFormat = DataFormat.Xml;
  7. request.AddParameter(“text/xml”, “<code>job</code>”, ParameterType.RequestBody);
  8. RestResponse restResponse = (RestResponse)rc.Execute(request);
  9. ResponseStatus responseStatus = restResponse.ResponseStatus;
Posted in asp.net, coding

SEO tactics

After watching Patrick McKenzie’s presentations from MicroConf 2011 and 2012, I’ve distilled a few tactics I’m going to try and report back on.

(in no particular order)

1.  first-time user experience (FTUE) is another critical step in the process of generating a true, paying customer.  Spend all that time finding and courting the customer only to stop after they’ve signed up (even if they’ve paid) is a good way to lose money.  I’m going to add some logic to my startup apps where the first time a user signs-in they will receive a simple dialog box that welcomes them, tells them what’s expected and gives them a pointer to the help PDF.  Then I’m going to track which buttons they click.

2.  Grab the “productname” .org / .net / .com.  If your product is software for sailors then grab “sailingsoftware.com / .org / .net” gets you a lot of points with Google.

 

Posted in Uncategorized

Growth Hacking – tactic 1

1. OPN – Other people’s networks – use existing social networks of those users you are interested in to find new users for your startup.  Partner with these networks and do “co-marketing” opportunities

Posted in Uncategorized

Hacking the Customer Development Process – Part 4

Ideas from Dan Martell’s MicroConf 2012 speech on growth hacking

 

1.  (for enterprise software) – find out from whom your potential customers are already buying from

2.  getstatisfaction.com – use to find niche software products.  Find out what customers of similar products/competitors are complaining about

 

From (http://makedollarsonlinenow.blogspot.com/2010/05/how-to-know-profitable-market-online.html)

1.  Use omgili.com to search online discussion forums about your business idea.  Read up on these topics and learn what people are talking about, what their frustrations are and ultimately where the opportunities are

Posted in Uncategorized

Hacking the customer development process – part 3

An interesting tip from a Rob Walling video.  Use YouTube to drive SEO gains.  Find a question, with important keywords, and create a new screen cast video that answers this question.  Create a youtube video where the title of the video is the question with important keywords.

I’m going to try this out and I’ll report back if there are any interesting results.

Posted in Uncategorized

Hacking the customer development process – part 2

After listening to Product People TV podcast, I wanted to draw attention to the process outlined by Jason Evanish – http://productpeople.tv/2013/03/27/ep19-jason-evanish-shares-his-process-for-understanding-customers/.

  1. Create a landing page or blog post. Both should have a sign-up form for email addresses (at least) – it should talk about the problem you’re solving
  2. Drive traffic to the landing page
    1. Use PPC (i.e. Google adwords)
    2. Use other blogs with high traffic
    3. Use twitter ads
    4. Post to LinkedIn groups that are relevant
  3. GOAL (milestone) is to have between 100 – 1000 email addresses
  4. Talk to 7-10 sign-ups in a lengthy interview
    1. Gather common thoughts/answers/questions from these interviews
  5. Create survey based on lengthy interview and send to everyone on mailing list (step 3)
    1. Create multiple choice questions with answers you already have from lengthy interviews (Step 4)
  6. Start building the solution

For other thoughts on hacking the customer development process, check out part 1:  http://michaelentrepreneur.com/2013/04/20/hacking-the-cu…covery-process/ ‎

Posted in Uncategorized

Validating B2B software market demand

I have a single business interested in Genesis One (what I’m calling my first potential SaaS software solution).  Since then I’ve found competitors, followed up with this initial customer and everytime this initial customer rejected any alternatives to Genesis One telling me that none of these addressed their specific need.  All is good, right?  I must have a niche?  But I still felt uneasy about spending time on building something that only had one validated customer.  It’s difficult to find Businesses willing to talk to you about whether your niche software solution will be right for them.  I have a new technique for validating a B2B SaaS software solution.

Validating B2B SaaS software solution

  1. Find competitor(s) in your B2B SaaS software solution niche
  2. Search LinkedIn for folks who used to work at competitors in their sales department
  3. Send messages/Connect with these folks and ask them for a brief chat about your software market niche
  4. Those who respond positively, schedule an interview (preferably over the phone)

I came about this and found someone who immediately responded positively and gave me their phone number.  They said they would be happy to give me the history of the market niche, explain the sales cycle and also offer growth opportunities.  Excellent!  I’ll update next week after our chat.

Posted in Uncategorized

Hacking the customer discovery process – part 1

I’m the type of person that needs to understand things in a very methodical way.  Must be due to my engineering background, but I like things explained very clearly, so when it comes to customer development, it’s not enough that I hear, “talk to customer to find their pain points”, I need to know how to find potential customers who are willing to talk to me and I need to know how to talk to them… details!  So, I’m going to try to find as detailed a process as I can.  Here’s what I have so far from a podcast at Mixergy.

http://mixergy.com/listen-to-dane-maxwell-call-a-prospect-and-hear-how-he-extracts-a-profitable-business-idea/

My break down of Dane’s call with Pool Guy.  What are your contributions?  What do you see/hear differently?

 

1.  Start by asking what a typical work day looks like

a. What is the most important area of your business

I. Ask for a “step by step” explanation – “What steps do you go through when doing that?”

II. Write down every step so you can recall it easily later

2.  When you hear a step in the process that could do with more explanation or a break down into smaller tasks

a.  Repeat the previous steps you heard in the process up to the step you want details for confirmation and to show them you’re listening

b.  At the step you want more detail, you repeat what he said and ask a question about that step to probe for more detail

c.  Ask follow up questions to get more details about the sub-steps

3.         At any point that the person complains about something in the process try one of the following

a.  Say, “that sounds really painful”

I.  This can lead to the person agreeing and going into more detail about the pain points

b.  Ask them how much it costs them when that painful problem occurs

4.         Continue repeating the steps you hear to confirm and to assure the person you’re listening

5.  Repeat step 2 & 3 until you hear an issue during step 3 that is clearly something the person finds very painful and demonstrates it has a high cost to them

a.  If the person offers their own software solution, make notes of this

 

Posted in customer development, lead generation

Update on Genesis One – the competition!

Finding a lot of competitors in this market.  It seems fairly well established and crowded.  It was definitely a hit to the gut to see such a thing as talking with the lead who said “we’ll be your first customer” and “there must be tons of businesses out there that need this too!” really built my hopes up.

Having a lot of competitors certainly validates the market, however I’ll need to find a niche that is still lucrative and will be my own or at least significantly reduced competition if I am to enter the market.  Still haven’t written a line of code (good!), but I feel I’m still a long way from doing so.

Posted in customer development, lead generation