public virtual int InsertFeatureType(FeatureTypeRecord rec) { var @param = new { rec.TenantId, rec.Name }; return(this.session.Insert( nameof(this.InsertFeatureType), @param)); }
private FeatureTypeRecord InsertFeatureType(int tenantId, string name) { var rec = new FeatureTypeRecord { TenantId = tenantId, Name = name, }; rec.Id = this.repository.InsertFeatureType(rec); return(rec); }
private string ComputeHash(MD5 md5, FeatureTypeRecord featureType) { var attrs = this.repository.GetAttributes(featureType.Id); var chunks = attrs .Select(x => string.Concat(x.Name, x.DataTypeId)) .ToArray(); var str = string.Join(string.Empty, chunks); var buf = Encoding.UTF8.GetBytes(str); var hash = md5.ComputeHash(buf); return(Convert.ToBase64String(hash)); }