Monday, July 20, 2015

bizarre NullLogger behaviour

i was using NullLogger in orchard and I needed to do this
    public MenuProvider(UrlHelper urlHelper, IOrchardServices services)
              {
                     _urlHelper = urlHelper;
                     _services = services;
            Logger = NullLogger.Instance;

              }
instead of just referring to NullLogger.Instance.Log("blah")

Thursday, July 9, 2015

View dependencies

in ssms is not always correct because it depends on sysdepends



this is more accurate

select t.name as TableWithForeignKey, fk.constraint_column_id as FK_PartNo , c.name as ForeignKeyColumn
from sys.foreign_key_columns as fk
inner join sys.tables as t on fk.parent_object_id = t.object_id
inner join sys.columns as c on fk.parent_object_id = c.object_id and fk.parent_column_id = c.column_id
where fk.referenced_object_id = (select object_id from sys.tables where name = 'BLAH')
order by TableWithForeignKey, FK_PartNo

cache: false in $.ajax( calls

work because they add the following request header
  1. Cache-Control:
    no-cache

Wednesday, July 8, 2015

De-serialization issue checklist

make sure

1) all base classes and properties are properly adorned
          [DataContract]
          [Serializable]

2) base class and property may need also knowntype
       [KnownType(typeof(BlahBase))]

        public class Blah: BlahBase

in order to get type name from collection

 typeof(T).FullName.Between(


the between is an extension i found here 

for Serialization with distributed caching

 [DataContract]

was not enough

i needed

[Serializable]