Getting Error while creating shared.cs file?
hello everyone, i m using code first existing database approach in app. i have created prodataclass :dbcontext . i want check existing records using custom validation. i have writtten custon classand added following method readonly static prodataclass datacontext = new prodataclass(); public static validationresult validateduplicatecirclecode(string validatecirlecode, validationcontext context) { circle currentcircle = context.objectinstance circle; if (currentcircle == null) return validationresult.success; circle matchingcircle=null; if ((matchingcircle = (from t in datacontext.circles t.circlecode== currentcircle.circlecode select t).firstordefault()) != null) { return new validationresult(errorresources.cannotinsertduplicatecirclecode, new string[] { "circlecode" }); } else { return validationresult.success; ...