Showing posts with label visual c#. Show all posts
Showing posts with label visual c#. Show all posts

Thursday, May 14, 2020

Handy way to skeleton code a needed function in C#, so you can build without errors.

So I developed this technique years ago whilst Java was my primary coding language.  It's a great way to put a place holder method in while you're still writing code in another class or method.  I'm going to use C# today as that is primarily what I am coding with these days, and when I start talking about Asp .Net Core development that will be the language we will be using.

So if I need to place a call to a method that I haven't written yet, what I will do is quickly code a skeleton first like this.

public int myMethod()
{
    int returnValue = 0;



    return returnValue;
}

This way I can keep coding my main section as I want without Visual Studio, or Visual Studio Code complaining about a non-existent method call. Also, it will enable any test builds. This is especially useful for Asp .Net Core projects that involve Entity Framework as you need to be able to build to perform migrations or database updates.


Take care, my nerds!!!

Friday, May 24, 2013

Learning C#

So I decided to finally take the plunge.  Despite getting a sneak preview of C# way back in 2000-2001 I never really learned it.  I delved into .NET programming a bit but only from an ASP and C++ perspective.  We have need of a utility at work, and I have already built one in VBA on top of Excel 2007.  To say it's quirky is a bit of understatement.  I've decided to build it again as a stand alone app and learn C# while I'm at it.

After all the issues I had with VBA and different forms I'm going to use a MVP framework called MVC#.  This should make keeping track of authentication and any persistent data fairly easy.

The program is to manage medication administration records at work.  This way we can generate them rather than typing them up every time, and gives us a record of what a particular client had received in the past.  Since we will be dealing with sensitive client information that must remain confidential I will have to add encryption to the data.  Rather than use SQL I want this to be easy to deploy since we don't usually have administrator access at work.  I will use flat files to save all the information, and the "database" will be just the model component of the Model View Presentation framework.

So I will post more details in my next post.  Until next time.

Nerdtek out!