/// <summary> /// Instancia um novo objeto GUID com o valor passado /// </summary> /// <param name="guid">valor do GUID</param> public GUID(IID guid) { long result = 0; long.TryParse(guid == null ? "" : guid.ToString(), out result); this.guid = result; }
public Command CreateCommandDelete(TableDefinitionAttribute tableDefinition, IID id) { Command command = connection.CreateCommand(); command.Transaction = transaction; string pkName = GetPKName(tableDefinition); string commandText = ""; commandText = string.Format("DELETE FROM {0} WHERE {1} = @where_1;", tableDefinition.TableName, pkName); command.CommandText = commandText; command.Parameters.Add(new Parameter("@where_1", GenericDbType.String) { SourceColumn = pkName, Value = id.ToString() }); return(command); }
public static short getOpCode(this IID id) { var member = typeof(IID).GetMember(id.ToString()).FirstOrDefault(m => m.DeclaringType == typeof(IID)); if (member is null) { throw new InvalidOperationException(); } var attr = member.GetCustomAttributes(typeof(OpCodeAttribute), false).FirstOrDefault() as OpCodeAttribute; if (attr is null) { throw new InvalidOperationException( $"Field '{id}' of type '{nameof(IID)}' not found '{nameof(OpCodeAttribute)}' attribute. "); } return(attr.OpCode); }
public virtual Parser <string> InstructionToken(IID instruction) => (from dot in Parse.Char('.') from ident in Parse.String(instruction.ToString().Replace("_", ".")).Text() select ident).Token().Named($"{instruction} expression");