Wednesday, November 30, 2011

Saturday, November 19, 2011

Ok, Linq just amazes me....

I needed to initialize a list of new objects, one record for each day of the month selected with that day (int) set in the DateOfResult field.

If you look below, the Range function is the trick here, along with the anonymous type initializer (is that the correct term?)  Just Amazing........  Thank you to Igor Ostrovsky for the help.


public ClientMedicalOutcomeObjective New(bool persist,DateTime MonthYear)
{
 
    ClientMedicalOutcomeObjective newObjective = new ClientMedicalOutcomeObjective();
 
    var resultsForTheWholeMonth = 
        from m in Enumerable.Range(1,DateTime.DaysInMonth(MonthYear.Year,MonthYear.Month))
        select new ClientMedicalOutcomeObjectiveResult()
            {   
                DateOfResult = m,
                ObjectiveResultTypeFk = 0 //The none selected
            };
 
    newObjective.ClientMedicalOutcomeObjectiveResultCollection = 
        new TList<ClientMedicalOutcomeObjectiveResult>resultsForTheWholeMonth.ToList());
            
    this.DeepSave(newObjective);
 
    return newObjective;
}

Thursday, November 03, 2011

It's Mine, I came up with it.

I'm goin' "Full Taco" on it.
Definition:  To exert full effort and all your humanly possible abilities to crush the task at hand.

Sunday, October 30, 2011

A very insightful blog article with may items on it that I found I've known about or used in the past.  My favorite happens to be one that I was not aware I was using, and using it well I might add.

Modesty is not a career-enhancing character trait:



Friday, October 28, 2011

I know it's kinda freshman to admit this, but Logic and the factoring of multiple discreet parameters to as small and efficient a code statement as possible is really cool.